Make sure we don't get durations with decimals

This commit is contained in:
Deluan 2020-11-05 18:27:46 -05:00
parent 8d7931b3bc
commit 6542842938
1 changed files with 2 additions and 1 deletions

View File

@ -15,7 +15,8 @@ const format = (d) => {
const minutes = Math.floor(d / 60) % 60
const seconds = d % 60
return [hours, minutes, seconds]
.map((v) => (v < 10 ? '0' + v : v))
.map((v) => Math.round(v).toString())
.map((v) => (v.length !== 2 ? '0' + v : v))
.filter((v, i) => v !== '00' || i > 0)
.join(':')
}