diff --git a/lib/utils.js b/lib/utils.js index d1cff89..a92be06 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -104,13 +104,13 @@ exports.getSplitDuration = function (duration) { let dur = duration; let retObj = {}; retObj.milliseconds = dur % 1000; - dur = Math.round(dur / 1000); + dur = Math.floor(dur / 1000); retObj.seconds = dur % 60; - dur = Math.round(dur / 60); + dur = Math.floor(dur / 60); retObj.minutes = dur % 60; - dur = Math.round(dur / 60); + dur = Math.floor(dur / 60); retObj.hours = dur % 24; - dur = Math.round(dur / 24); + dur = Math.floor(dur / 24); retObj.days = dur; return retObj; }; @@ -272,4 +272,4 @@ exports.logLevels = { 'warning': 3, 'warn': 3, 'error:': 4 -}; \ No newline at end of file +}; diff --git a/web/http/scripts/query.js b/web/http/scripts/query.js index ac1e987..b65e12d 100644 --- a/web/http/scripts/query.js +++ b/web/http/scripts/query.js @@ -13,13 +13,13 @@ function getSplitDuration (duration) { let dur = duration; let retObj = {}; retObj.milliseconds = dur % 1000; - dur = Math.round(dur / 1000); + dur = Math.floor(dur / 1000); retObj.seconds = dur % 60; - dur = Math.round(dur / 60); + dur = Math.floor(dur / 60); retObj.minutes = dur % 60; - dur = Math.round(dur / 60); + dur = Math.floor(dur / 60); retObj.hours = dur % 24; - dur = Math.round(dur / 24); + dur = Math.floor(dur / 24); retObj.days = dur; return retObj; }