热力图bug

This commit is contained in:
Developer
2026-03-12 23:57:01 +08:00
parent a55bcd46ea
commit 2e7578afde
7 changed files with 245 additions and 229 deletions

View File

@@ -5,9 +5,19 @@ export function formatCount(n: number): string {
}
export function formatDuration(seconds: number): string {
const m = Math.floor(seconds / 60);
const h = Math.floor(seconds / 3600);
const m = Math.floor((seconds % 3600) / 60);
const s = seconds % 60;
return `${m}:${String(s).padStart(2, '0')}`;
const mm = String(m).padStart(2, '0');
const ss = String(s).padStart(2, '0');
if (h > 0) {
const hh = String(h).padStart(2, '0');
return `${hh}:${mm}:${ss}`;
} else {
return `${mm}:${ss}`;
}
}
export function formatTime(ctime: number): string {