mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
Added hours to time with skips
This commit is contained in:
parent
48861439b7
commit
2d74ce2093
1 changed files with 5 additions and 4 deletions
|
@ -331,9 +331,10 @@ class Utils {
|
||||||
return seconds % 60;
|
return seconds % 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFormattedTime(seconds: number, precise?: boolean) {
|
getFormattedTime(seconds: number, precise?: boolean): string {
|
||||||
let minutes = Math.floor(seconds / 60);
|
let hours = Math.floor(seconds / 60 / 60);
|
||||||
let secondsNum: number = seconds - minutes * 60;
|
let minutes = Math.floor(seconds / 60) % 60;
|
||||||
|
let secondsNum = seconds % 60;
|
||||||
if (!precise) {
|
if (!precise) {
|
||||||
secondsNum = Math.floor(secondsNum);
|
secondsNum = Math.floor(secondsNum);
|
||||||
}
|
}
|
||||||
|
@ -345,7 +346,7 @@ class Utils {
|
||||||
secondsDisplay = "0" + secondsDisplay;
|
secondsDisplay = "0" + secondsDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
let formatted = minutes + ":" + secondsDisplay;
|
let formatted = (hours ? hours + ":" : "") + minutes + ":" + secondsDisplay;
|
||||||
|
|
||||||
return formatted;
|
return formatted;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue