- getSplitDuration now returns the correct time
pull/33/head
Trivernis 6 years ago
parent 60366de6b3
commit f8a765799e

@ -104,13 +104,13 @@ exports.getSplitDuration = function (duration) {
let dur = duration; let dur = duration;
let retObj = {}; let retObj = {};
retObj.milliseconds = dur % 1000; retObj.milliseconds = dur % 1000;
dur = Math.round(dur / 1000); dur = Math.floor(dur / 1000);
retObj.seconds = dur % 60; retObj.seconds = dur % 60;
dur = Math.round(dur / 60); dur = Math.floor(dur / 60);
retObj.minutes = dur % 60; retObj.minutes = dur % 60;
dur = Math.round(dur / 60); dur = Math.floor(dur / 60);
retObj.hours = dur % 24; retObj.hours = dur % 24;
dur = Math.round(dur / 24); dur = Math.floor(dur / 24);
retObj.days = dur; retObj.days = dur;
return retObj; return retObj;
}; };

@ -13,13 +13,13 @@ function getSplitDuration (duration) {
let dur = duration; let dur = duration;
let retObj = {}; let retObj = {};
retObj.milliseconds = dur % 1000; retObj.milliseconds = dur % 1000;
dur = Math.round(dur / 1000); dur = Math.floor(dur / 1000);
retObj.seconds = dur % 60; retObj.seconds = dur % 60;
dur = Math.round(dur / 60); dur = Math.floor(dur / 60);
retObj.minutes = dur % 60; retObj.minutes = dur % 60;
dur = Math.round(dur / 60); dur = Math.floor(dur / 60);
retObj.hours = dur % 24; retObj.hours = dur % 24;
dur = Math.round(dur / 24); dur = Math.floor(dur / 24);
retObj.days = dur; retObj.days = dur;
return retObj; return retObj;
} }

Loading…
Cancel
Save