Fix wrong timestamps for sub-60 second times
This commit is contained in:
parent
2c4af55985
commit
e19f8f9c00
@ -40,6 +40,9 @@ function toTimestamp(n: number): string {
|
|||||||
result.push(n % 60);
|
result.push(n % 60);
|
||||||
n = Math.floor(n / 60);
|
n = Math.floor(n / 60);
|
||||||
}
|
}
|
||||||
|
if (result.length == 1) {
|
||||||
|
result.push(0); // to get timestamps like "00:03"
|
||||||
|
}
|
||||||
return result
|
return result
|
||||||
.map((n, i) => (i >= 2 ? n.toString() : n.toString().padStart(2, "0")))
|
.map((n, i) => (i >= 2 ? n.toString() : n.toString().padStart(2, "0")))
|
||||||
.reverse()
|
.reverse()
|
||||||
|
Loading…
Reference in New Issue
Block a user