fix rendering of duration on chrome in mobile interface for: -9.99999883788405e-7
This commit is contained in:
parent
8c4504d662
commit
9d58fb7f36
1 changed files with 5 additions and 1 deletions
|
|
@ -6,11 +6,15 @@ const parseDuration = function(string) {
|
|||
};
|
||||
|
||||
const formatDuration = function(seconds) {
|
||||
if (isString(seconds)) {
|
||||
seconds = parseFloat(seconds)
|
||||
}
|
||||
seconds = seconds.toFixed(3)
|
||||
var parts = [
|
||||
parseInt(seconds / 86400),
|
||||
parseInt(seconds % 86400 / 3600),
|
||||
parseInt(seconds % 3600 / 60),
|
||||
s = parseInt(seconds % 60)
|
||||
parseInt(seconds % 60)
|
||||
]
|
||||
return parts.map(p => { return p.toString().padStart(2, '0')}).join(':')
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue