aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2021-09-28 10:47:37 -0400
committerGitHub <[email protected]>2021-09-28 10:47:37 -0400
commit811c80d544653420e99152a78e64d9c079251ede (patch)
tree7d9be813ea28bd84560a1cd408ddf34fdb90268a
parentfe1717788f28e847cdb23f7361bd68bb1302fb4a (diff)
parent58cc548739f3e1eb79d4952588493502f2acea5e (diff)
downloadmuse-811c80d544653420e99152a78e64d9c079251ede.tar.xz
muse-811c80d544653420e99152a78e64d9c079251ede.zip
Merge pull request #368 from Hellysonrp/fix-pretty-time
-rw-r--r--src/utils/time.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils/time.ts b/src/utils/time.ts
index 734cb00..07a8a64 100644
--- a/src/utils/time.ts
+++ b/src/utils/time.ts
@@ -1,12 +1,13 @@
export const prettyTime = (seconds: number): string => {
const nSeconds = seconds % 60;
- const nMinutes = Math.floor(seconds / 60);
+ let nMinutes = Math.floor(seconds / 60);
const nHours = Math.floor(nMinutes / 60);
let res = '';
if (nHours !== 0) {
res += `${Math.round(nHours).toString().padStart(2, '0')}:`;
+ nMinutes -= nHours * 60;
}
res += `${Math.round(nMinutes).toString().padStart(2, '0')}:${Math.round(nSeconds).toString().padStart(2, '0')}`;