mirror of
https://gh-proxy.org/https://github.com/tiajinsha/JKVideo
synced 2026-07-08 15:33:51 +08:00
热力图bug
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user