diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-17 08:26:02 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-17 08:26:02 +0200 |
commit | b18a9cf86ea25bc52d9cfea584e3aa8bfbe81f0a (patch) | |
tree | 2e3d8df53e48b5dd2897f796295401faaec42a85 /toolkit/content/widgets/timekeeper.js | |
parent | 90c68b34abf51ae0b1a2848094fc3115b30ee498 (diff) | |
parent | e719d7b3be222dfafad78c71761bad2bafb1243d (diff) | |
download | UXP-b18a9cf86ea25bc52d9cfea584e3aa8bfbe81f0a.tar UXP-b18a9cf86ea25bc52d9cfea584e3aa8bfbe81f0a.tar.gz UXP-b18a9cf86ea25bc52d9cfea584e3aa8bfbe81f0a.tar.lz UXP-b18a9cf86ea25bc52d9cfea584e3aa8bfbe81f0a.tar.xz UXP-b18a9cf86ea25bc52d9cfea584e3aa8bfbe81f0a.zip |
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into pm_url_1
Diffstat (limited to 'toolkit/content/widgets/timekeeper.js')
-rw-r--r-- | toolkit/content/widgets/timekeeper.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/toolkit/content/widgets/timekeeper.js b/toolkit/content/widgets/timekeeper.js index 2234c9e50..3b4e7eb0a 100644 --- a/toolkit/content/widgets/timekeeper.js +++ b/toolkit/content/widgets/timekeeper.js @@ -14,7 +14,7 @@ * { * {Date} min * {Date} max - * {Number} stepInMs + * {Number} step * {String} format: Either "12" or "24" * } */ @@ -286,15 +286,15 @@ function TimeKeeper(props) { * } */ _getSteps(startValue, endValue, minStep, formatter) { - const { min, max, stepInMs } = this.props; + const { min, max, step } = this.props; // The timeStep should be big enough so that there won't be // duplications. Ex: minimum step for minute should be 60000ms, // if smaller than that, next step might return the same minute. - const timeStep = Math.max(minStep, stepInMs); + const timeStep = Math.max(minStep, step); // Make sure the starting point and end point is not off step let time = min.valueOf() + Math.ceil((startValue - min.valueOf()) / timeStep) * timeStep; - let maxValue = min.valueOf() + Math.floor((max.valueOf() - min.valueOf()) / stepInMs) * stepInMs; + let maxValue = min.valueOf() + Math.floor((max.valueOf() - min.valueOf()) / step) * step; let steps = []; // Increment by timeStep until reaching the end of the range. @@ -410,9 +410,9 @@ function TimeKeeper(props) { * @return {Boolean} */ _isOffStep(time) { - const { min, stepInMs } = this.props; + const { min, step } = this.props; - return (time.valueOf() - min.valueOf()) % stepInMs != 0; + return (time.valueOf() - min.valueOf()) % step != 0; } }; } |