From fe297d4c56a76c389754499dea0371c0d30a384a Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 5 Sep 2019 21:42:12 -0700 Subject: [PATCH] Fixes for PR #1654 --- src/renderer/pages/player-page.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/pages/player-page.js b/src/renderer/pages/player-page.js index b58dba56..43f610d6 100644 --- a/src/renderer/pages/player-page.js +++ b/src/renderer/pages/player-page.js @@ -757,14 +757,14 @@ function formatTime (time, total) { return '0:00' } - const totalHours = total / 3600 | 0 - const totalMinutes = total / 60 | 0 - const hours = time / 3600 | 0 - let minutes = time % 3600 / 60 | 0 + const totalHours = Math.floor(total / 3600) + const totalMinutes = Math.floor(total / 60) + const hours = Math.floor(time / 3600) + let minutes = Math.floor(time % 3600 / 60) if (totalMinutes > 9 && minutes < 10) { minutes = '0' + minutes } - const seconds = `0${time % 60 | 0}`.slice(-2) + const seconds = `0${Math.floor(time % 60)}`.slice(-2) return (totalHours > 0 ? hours + ':' : '') + minutes + ':' + seconds }