Make sure we don't get durations with decimals
This commit is contained in:
parent
8d7931b3bc
commit
6542842938
1 changed files with 2 additions and 1 deletions
|
|
@ -15,7 +15,8 @@ const format = (d) => {
|
||||||
const minutes = Math.floor(d / 60) % 60
|
const minutes = Math.floor(d / 60) % 60
|
||||||
const seconds = d % 60
|
const seconds = d % 60
|
||||||
return [hours, minutes, seconds]
|
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)
|
.filter((v, i) => v !== '00' || i > 0)
|
||||||
.join(':')
|
.join(':')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue