Fixes for PR #1654

This commit is contained in:
Feross Aboukhadijeh
2019-09-05 21:42:12 -07:00
parent b16971491f
commit fe297d4c56

View File

@@ -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
}