Fix occasionally displaying times as 1:010
This commit is contained in:
parent
6c99752f37
commit
a32b29976e
@ -183,7 +183,9 @@ export function b64decode(data) {
|
|||||||
export function format_duration(seconds, places = 0) {
|
export function format_duration(seconds, places = 0) {
|
||||||
let mins = Math.floor(seconds / 60);
|
let mins = Math.floor(seconds / 60);
|
||||||
let secs = seconds % 60;
|
let secs = seconds % 60;
|
||||||
return `${mins}:${secs < 10 ? '0' : ''}${secs.toFixed(places)}`;
|
let rounded_secs = secs.toFixed(places);
|
||||||
|
// TODO hours?
|
||||||
|
return `${mins}:${parseFloat(rounded_secs) < 10 ? '0' : ''}${rounded_secs}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DelayTimer {
|
export class DelayTimer {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user