aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2021-08-13 23:19:08 -0400
committerAjay Ramachandran <[email protected]>2021-08-13 23:19:08 -0400
commitf01a1ae4ec34005f69dfb2bbb382099f9006d42f (patch)
tree10114bb1ff53f5909bd7283211b3a96e11bc5c50
parentc8611adf50db454c2cee993e3b130497b7d5134d (diff)
downloadSponsorBlock-f01a1ae4ec34005f69dfb2bbb382099f9006d42f.tar.gz
SponsorBlock-f01a1ae4ec34005f69dfb2bbb382099f9006d42f.zip
Never show negative formatted time
-rw-r--r--src/utils.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils.ts b/src/utils.ts
index 0ea27238..c809e379 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -429,6 +429,8 @@ export default class Utils {
}
getFormattedTime(seconds: number, precise?: boolean): string {
+ seconds = Math.max(seconds, 0);
+
const hours = Math.floor(seconds / 60 / 60);
const minutes = Math.floor(seconds / 60) % 60;
let minutesDisplay = String(minutes);