formatDuration: use Math.abs(seconds)
This commit is contained in:
parent
db321b583b
commit
e7415059f0
1 changed files with 1 additions and 1 deletions
|
@ -595,7 +595,7 @@ Ox.formatDuration = function(seconds/*, decimals, format*/) {
|
||||||
var last = Ox.last(arguments),
|
var last = Ox.last(arguments),
|
||||||
format = last == 'short' || last == 'long' ? last : 'none',
|
format = last == 'short' || last == 'long' ? last : 'none',
|
||||||
decimals = Ox.isNumber(arguments[1]) ? arguments[1] : 0,
|
decimals = Ox.isNumber(arguments[1]) ? arguments[1] : 0,
|
||||||
seconds = Ox.round(seconds, decimals),
|
seconds = Ox.round(Math.abs(seconds), decimals),
|
||||||
values = [
|
values = [
|
||||||
Math.floor(seconds / 31536000),
|
Math.floor(seconds / 31536000),
|
||||||
Math.floor(seconds % 31536000 / 86400),
|
Math.floor(seconds % 31536000 / 86400),
|
||||||
|
|
Loading…
Reference in a new issue