summaryrefslogtreecommitdiffstats
path: root/toolkit/content/widgets/timekeeper.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-30 22:46:03 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-30 22:46:03 +0200
commit5941771281f0385328444f2a7f9643fb87e0a2e1 (patch)
tree98557d587b8d8a93e0555032ad7f80f716d9c2d9 /toolkit/content/widgets/timekeeper.js
parent6a44ab26592fbe95b69e1bf4d3a3b0de03a99b26 (diff)
downloadUXP-5941771281f0385328444f2a7f9643fb87e0a2e1.tar
UXP-5941771281f0385328444f2a7f9643fb87e0a2e1.tar.gz
UXP-5941771281f0385328444f2a7f9643fb87e0a2e1.tar.lz
UXP-5941771281f0385328444f2a7f9643fb87e0a2e1.tar.xz
UXP-5941771281f0385328444f2a7f9643fb87e0a2e1.zip
Bug 1382175 - Fix time picker step and min/max regressions
Diffstat (limited to 'toolkit/content/widgets/timekeeper.js')
-rw-r--r--toolkit/content/widgets/timekeeper.js12
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;
}
};
}