diff options
-rw-r--r-- | manifest/manifest.json | 2 | ||||
-rw-r--r-- | src/utils.ts | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/manifest/manifest.json b/manifest/manifest.json index ee6e5c35..b15524c7 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_fullName__", "short_name": "SponsorBlock", - "version": "2.0.4.1", + "version": "2.0.4.2", "default_locale": "en", "description": "__MSG_Description__", "content_scripts": [{ diff --git a/src/utils.ts b/src/utils.ts index 53e4d694..43cdc68e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -334,6 +334,7 @@ class Utils { getFormattedTime(seconds: number, precise?: boolean): string { let hours = Math.floor(seconds / 60 / 60); let minutes = Math.floor(seconds / 60) % 60; + let minutesDisplay = String(minutes); let secondsNum = seconds % 60; if (!precise) { secondsNum = Math.floor(secondsNum); @@ -345,8 +346,12 @@ class Utils { //add a zero secondsDisplay = "0" + secondsDisplay; } + if (hours && minutes < 10) { + //add a zero + minutesDisplay = "0" + minutesDisplay; + } - let formatted = (hours ? hours + ":" : "") + minutes + ":" + secondsDisplay; + let formatted = (hours ? hours + ":" : "") + minutesDisplay + ":" + secondsDisplay; return formatted; } |