flatpickr 4.5.2.1 → 4.5.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flatpickr/version.rb +1 -1
- data/vendor/assets/javascripts/flatpickr.js +2400 -2075
- data/vendor/assets/javascripts/flatpickr/l10n/ar.js +42 -20
- data/vendor/assets/javascripts/flatpickr/l10n/at.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/az.js +73 -0
- data/vendor/assets/javascripts/flatpickr/l10n/be.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/bg.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/bn.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/cat.js +71 -40
- data/vendor/assets/javascripts/flatpickr/l10n/cs.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/cy.js +81 -29
- data/vendor/assets/javascripts/flatpickr/l10n/da.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/de.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/default.js +62 -32
- data/vendor/assets/javascripts/flatpickr/l10n/eo.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/es.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/et.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/fa.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/fi.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/fo.js +73 -0
- data/vendor/assets/javascripts/flatpickr/l10n/fr.js +59 -23
- data/vendor/assets/javascripts/flatpickr/l10n/gr.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/he.js +49 -21
- data/vendor/assets/javascripts/flatpickr/l10n/hi.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/hr.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/hu.js +59 -23
- data/vendor/assets/javascripts/flatpickr/l10n/id.js +49 -22
- data/vendor/assets/javascripts/flatpickr/l10n/index.js +3147 -1036
- data/vendor/assets/javascripts/flatpickr/l10n/is.js +71 -0
- data/vendor/assets/javascripts/flatpickr/l10n/it.js +56 -23
- data/vendor/assets/javascripts/flatpickr/l10n/ja.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/km.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/ko.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/kz.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/lt.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/lv.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/mk.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/mn.js +47 -20
- data/vendor/assets/javascripts/flatpickr/l10n/ms.js +56 -21
- data/vendor/assets/javascripts/flatpickr/l10n/my.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/nl.js +59 -23
- data/vendor/assets/javascripts/flatpickr/l10n/no.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/pa.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/pl.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/pt.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/ro.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/ru.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/si.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/sk.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/sl.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/sq.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/sr-cyr.js +67 -0
- data/vendor/assets/javascripts/flatpickr/l10n/sr.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/sv.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/th.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/tr.js +57 -22
- data/vendor/assets/javascripts/flatpickr/l10n/uk.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/vn.js +55 -20
- data/vendor/assets/javascripts/flatpickr/l10n/zh-tw.js +68 -0
- data/vendor/assets/javascripts/flatpickr/l10n/zh.js +55 -20
- data/vendor/assets/javascripts/flatpickr/plugins/confirmDate/confirmDate.js +63 -35
- data/vendor/assets/javascripts/flatpickr/plugins/labelPlugin/labelPlugin.js +24 -26
- data/vendor/assets/javascripts/flatpickr/plugins/minMaxTimePlugin.js +229 -200
- data/vendor/assets/javascripts/flatpickr/plugins/monthSelect/monthSelect.js +68 -51
- data/vendor/assets/javascripts/flatpickr/plugins/rangePlugin.js +136 -141
- data/vendor/assets/javascripts/flatpickr/plugins/scrollPlugin.js +43 -49
- data/vendor/assets/javascripts/flatpickr/plugins/weekSelect/weekSelect.js +70 -67
- data/vendor/assets/stylesheets/flatpickr.css +12 -1
- data/vendor/assets/stylesheets/flatpickr/themes/airbnb.css +12 -1
- data/vendor/assets/stylesheets/flatpickr/themes/confetti.css +12 -1
- data/vendor/assets/stylesheets/flatpickr/themes/dark.css +12 -1
- data/vendor/assets/stylesheets/flatpickr/themes/light.css +12 -1
- data/vendor/assets/stylesheets/flatpickr/themes/material_blue.css +12 -1
- data/vendor/assets/stylesheets/flatpickr/themes/material_green.css +12 -1
- data/vendor/assets/stylesheets/flatpickr/themes/material_orange.css +12 -1
- data/vendor/assets/stylesheets/flatpickr/themes/material_red.css +12 -1
- metadata +7 -2
@@ -1,97 +1,86 @@
|
|
1
|
-
/* flatpickr v4.5.2, @license MIT */
|
2
1
|
(function (global, factory) {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
}(this,
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
3
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
4
|
+
(global = global || self, global.minMaxTimePlugin = factory());
|
5
|
+
}(this, function () { 'use strict';
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
};
|
11
|
-
var int = function int(bool) {
|
12
|
-
return bool === true ? 1 : 0;
|
13
|
-
};
|
7
|
+
var pad = function (number) { return ("0" + number).slice(-2); };
|
8
|
+
var int = function (bool) { return (bool === true ? 1 : 0); };
|
14
9
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
10
|
+
var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; };
|
11
|
+
var formats = {
|
12
|
+
// get the date in UTC
|
13
|
+
Z: function (date) { return date.toISOString(); },
|
14
|
+
// weekday name, short, e.g. Thu
|
15
|
+
D: function (date, locale, options) {
|
16
|
+
return locale.weekdays.shorthand[formats.w(date, locale, options)];
|
21
17
|
},
|
22
|
-
|
23
|
-
|
18
|
+
// full month name e.g. January
|
19
|
+
F: function (date, locale, options) {
|
20
|
+
return monthToStr(formats.n(date, locale, options) - 1, false, locale);
|
24
21
|
},
|
25
|
-
|
26
|
-
|
22
|
+
// padded hour 1-12
|
23
|
+
G: function (date, locale, options) {
|
24
|
+
return pad(formats.h(date, locale, options));
|
27
25
|
},
|
28
|
-
|
29
|
-
|
26
|
+
// hours with leading zero e.g. 03
|
27
|
+
H: function (date) { return pad(date.getHours()); },
|
28
|
+
// day (1-30) with ordinal suffix e.g. 1st, 2nd
|
29
|
+
J: function (date, locale) {
|
30
|
+
return locale.ordinal !== undefined
|
31
|
+
? date.getDate() + locale.ordinal(date.getDate())
|
32
|
+
: date.getDate();
|
30
33
|
},
|
31
|
-
|
32
|
-
|
34
|
+
// AM/PM
|
35
|
+
K: function (date, locale) { return locale.amPM[int(date.getHours() > 11)]; },
|
36
|
+
// shorthand month e.g. Jan, Sep, Oct, etc
|
37
|
+
M: function (date, locale) {
|
38
|
+
return monthToStr(date.getMonth(), true, locale);
|
33
39
|
},
|
34
|
-
|
35
|
-
|
40
|
+
// seconds 00-59
|
41
|
+
S: function (date) { return pad(date.getSeconds()); },
|
42
|
+
// unix timestamp
|
43
|
+
U: function (date) { return date.getTime() / 1000; },
|
44
|
+
W: function (date, _, options) {
|
45
|
+
return options.getWeek(date);
|
36
46
|
},
|
37
|
-
|
38
|
-
|
47
|
+
// full year e.g. 2016
|
48
|
+
Y: function (date) { return date.getFullYear(); },
|
49
|
+
// day in month, padded (01-30)
|
50
|
+
d: function (date) { return pad(date.getDate()); },
|
51
|
+
// hour from 1-12 (am/pm)
|
52
|
+
h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); },
|
53
|
+
// minutes, padded with leading zero e.g. 09
|
54
|
+
i: function (date) { return pad(date.getMinutes()); },
|
55
|
+
// day in month (1-30)
|
56
|
+
j: function (date) { return date.getDate(); },
|
57
|
+
// weekday name, full, e.g. Thursday
|
58
|
+
l: function (date, locale) {
|
59
|
+
return locale.weekdays.longhand[date.getDay()];
|
39
60
|
},
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
},
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
}
|
52
|
-
|
53
|
-
return date.getFullYear();
|
54
|
-
},
|
55
|
-
d: function d(date) {
|
56
|
-
return pad(date.getDate());
|
57
|
-
},
|
58
|
-
h: function h(date) {
|
59
|
-
return date.getHours() % 12 ? date.getHours() % 12 : 12;
|
60
|
-
},
|
61
|
-
i: function i(date) {
|
62
|
-
return pad(date.getMinutes());
|
63
|
-
},
|
64
|
-
j: function j(date) {
|
65
|
-
return date.getDate();
|
66
|
-
},
|
67
|
-
l: function l(date, locale) {
|
68
|
-
return locale.weekdays.longhand[date.getDay()];
|
69
|
-
},
|
70
|
-
m: function m(date) {
|
71
|
-
return pad(date.getMonth() + 1);
|
72
|
-
},
|
73
|
-
n: function n(date) {
|
74
|
-
return date.getMonth() + 1;
|
75
|
-
},
|
76
|
-
s: function s(date) {
|
77
|
-
return date.getSeconds();
|
78
|
-
},
|
79
|
-
w: function w(date) {
|
80
|
-
return date.getDay();
|
81
|
-
},
|
82
|
-
y: function y(date) {
|
83
|
-
return String(date.getFullYear()).substring(2);
|
84
|
-
}
|
85
|
-
};
|
61
|
+
// padded month number (01-12)
|
62
|
+
m: function (date) { return pad(date.getMonth() + 1); },
|
63
|
+
// the month number (1-12)
|
64
|
+
n: function (date) { return date.getMonth() + 1; },
|
65
|
+
// seconds 0-59
|
66
|
+
s: function (date) { return date.getSeconds(); },
|
67
|
+
// Unix Milliseconds
|
68
|
+
u: function (date) { return date.getTime(); },
|
69
|
+
// number of the day of the week
|
70
|
+
w: function (date) { return date.getDay(); },
|
71
|
+
// last two digits of year e.g. 16 for 2016
|
72
|
+
y: function (date) { return String(date.getFullYear()).substring(2); }
|
73
|
+
};
|
86
74
|
|
87
|
-
|
75
|
+
var defaults = {
|
88
76
|
_disable: [],
|
89
77
|
_enable: [],
|
90
78
|
allowInput: false,
|
91
79
|
altFormat: "F j, Y",
|
92
80
|
altInput: false,
|
93
81
|
altInputClass: "form-control input",
|
94
|
-
animate: typeof window === "object" &&
|
82
|
+
animate: typeof window === "object" &&
|
83
|
+
window.navigator.userAgent.indexOf("MSIE") === -1,
|
95
84
|
ariaDateFormat: "F j, Y",
|
96
85
|
clickOpens: true,
|
97
86
|
closeOnSelect: true,
|
@@ -105,10 +94,23 @@
|
|
105
94
|
enable: [],
|
106
95
|
enableSeconds: false,
|
107
96
|
enableTime: false,
|
108
|
-
errorHandler: function
|
109
|
-
|
97
|
+
errorHandler: function (err) {
|
98
|
+
return typeof console !== "undefined" && console.warn(err);
|
99
|
+
},
|
100
|
+
getWeek: function (givenDate) {
|
101
|
+
var date = new Date(givenDate.getTime());
|
102
|
+
date.setHours(0, 0, 0, 0);
|
103
|
+
// Thursday in current week decides the year.
|
104
|
+
date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));
|
105
|
+
// January 4 is always in week 1.
|
106
|
+
var week1 = new Date(date.getFullYear(), 0, 4);
|
107
|
+
// Adjust to Thursday in week 1 and count number of weeks from date to week1.
|
108
|
+
return (1 +
|
109
|
+
Math.round(((date.getTime() - week1.getTime()) / 86400000 -
|
110
|
+
3 +
|
111
|
+
((week1.getDay() + 6) % 7)) /
|
112
|
+
7));
|
110
113
|
},
|
111
|
-
getWeek: getWeek,
|
112
114
|
hourIncrement: 1,
|
113
115
|
ignoredFocusElements: [],
|
114
116
|
inline: false,
|
@@ -140,36 +142,67 @@
|
|
140
142
|
time_24hr: false,
|
141
143
|
weekNumbers: false,
|
142
144
|
wrap: false
|
143
|
-
|
145
|
+
};
|
144
146
|
|
145
|
-
|
147
|
+
var english = {
|
146
148
|
weekdays: {
|
147
|
-
|
148
|
-
|
149
|
+
shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
150
|
+
longhand: [
|
151
|
+
"Sunday",
|
152
|
+
"Monday",
|
153
|
+
"Tuesday",
|
154
|
+
"Wednesday",
|
155
|
+
"Thursday",
|
156
|
+
"Friday",
|
157
|
+
"Saturday",
|
158
|
+
]
|
149
159
|
},
|
150
160
|
months: {
|
151
|
-
|
152
|
-
|
161
|
+
shorthand: [
|
162
|
+
"Jan",
|
163
|
+
"Feb",
|
164
|
+
"Mar",
|
165
|
+
"Apr",
|
166
|
+
"May",
|
167
|
+
"Jun",
|
168
|
+
"Jul",
|
169
|
+
"Aug",
|
170
|
+
"Sep",
|
171
|
+
"Oct",
|
172
|
+
"Nov",
|
173
|
+
"Dec",
|
174
|
+
],
|
175
|
+
longhand: [
|
176
|
+
"January",
|
177
|
+
"February",
|
178
|
+
"March",
|
179
|
+
"April",
|
180
|
+
"May",
|
181
|
+
"June",
|
182
|
+
"July",
|
183
|
+
"August",
|
184
|
+
"September",
|
185
|
+
"October",
|
186
|
+
"November",
|
187
|
+
"December",
|
188
|
+
]
|
153
189
|
},
|
154
190
|
daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
155
191
|
firstDayOfWeek: 0,
|
156
|
-
ordinal: function
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
default:
|
171
|
-
return "th";
|
172
|
-
}
|
192
|
+
ordinal: function (nth) {
|
193
|
+
var s = nth % 100;
|
194
|
+
if (s > 3 && s < 21)
|
195
|
+
return "th";
|
196
|
+
switch (s % 10) {
|
197
|
+
case 1:
|
198
|
+
return "st";
|
199
|
+
case 2:
|
200
|
+
return "nd";
|
201
|
+
case 3:
|
202
|
+
return "rd";
|
203
|
+
default:
|
204
|
+
return "th";
|
205
|
+
}
|
173
206
|
},
|
174
207
|
rangeSeparator: " to ",
|
175
208
|
weekAbbreviation: "Wk",
|
@@ -177,116 +210,112 @@
|
|
177
210
|
toggleTitle: "Click to toggle",
|
178
211
|
amPM: ["AM", "PM"],
|
179
212
|
yearAriaLabel: "Year"
|
180
|
-
|
213
|
+
};
|
181
214
|
|
182
|
-
|
183
|
-
var
|
184
|
-
config = _ref$config === void 0 ? defaults : _ref$config,
|
185
|
-
_ref$l10n = _ref.l10n,
|
186
|
-
l10n = _ref$l10n === void 0 ? english : _ref$l10n;
|
215
|
+
var createDateFormatter = function (_a) {
|
216
|
+
var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c;
|
187
217
|
return function (dateObj, frmt, overrideLocale) {
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
218
|
+
var locale = overrideLocale || l10n;
|
219
|
+
if (config.formatDate !== undefined) {
|
220
|
+
return config.formatDate(dateObj, frmt, locale);
|
221
|
+
}
|
222
|
+
return frmt
|
223
|
+
.split("")
|
224
|
+
.map(function (c, i, arr) {
|
225
|
+
return formats[c] && arr[i - 1] !== "\\"
|
226
|
+
? formats[c](dateObj, locale, config)
|
227
|
+
: c !== "\\"
|
228
|
+
? c
|
229
|
+
: "";
|
230
|
+
})
|
231
|
+
.join("");
|
197
232
|
};
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
233
|
+
};
|
234
|
+
/**
|
235
|
+
* Compute the difference in dates, measured in ms
|
236
|
+
*/
|
237
|
+
function compareDates(date1, date2, timeless) {
|
238
|
+
if (timeless === void 0) { timeless = true; }
|
204
239
|
if (timeless !== false) {
|
205
|
-
|
240
|
+
return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -
|
241
|
+
new Date(date2.getTime()).setHours(0, 0, 0, 0));
|
206
242
|
}
|
207
|
-
|
208
243
|
return date1.getTime() - date2.getTime();
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
};
|
220
|
-
|
221
|
-
function minMaxTimePlugin(config) {
|
222
|
-
if (config === void 0) {
|
223
|
-
config = {};
|
224
|
-
}
|
244
|
+
}
|
245
|
+
/**
|
246
|
+
* Compute the difference in times, measured in ms
|
247
|
+
*/
|
248
|
+
function compareTimes(date1, date2) {
|
249
|
+
return (3600 * (date1.getHours() - date2.getHours()) +
|
250
|
+
60 * (date1.getMinutes() - date2.getMinutes()) +
|
251
|
+
date1.getSeconds() -
|
252
|
+
date2.getSeconds());
|
253
|
+
}
|
225
254
|
|
255
|
+
function minMaxTimePlugin(config) {
|
256
|
+
if (config === void 0) { config = {}; }
|
226
257
|
var state = {
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
258
|
+
formatDate: createDateFormatter({}),
|
259
|
+
tableDateFormat: config.tableDateFormat || "Y-m-d",
|
260
|
+
defaults: {
|
261
|
+
minTime: undefined,
|
262
|
+
maxTime: undefined
|
263
|
+
}
|
233
264
|
};
|
234
|
-
|
235
265
|
function findDateTimeLimit(date) {
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
return config.getTimeLimits && config.getTimeLimits(date);
|
266
|
+
if (config.table !== undefined) {
|
267
|
+
return config.table[state.formatDate(date, state.tableDateFormat)];
|
268
|
+
}
|
269
|
+
return config.getTimeLimits && config.getTimeLimits(date);
|
241
270
|
}
|
242
|
-
|
243
271
|
return function (fp) {
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
272
|
+
return {
|
273
|
+
onReady: function () {
|
274
|
+
state.formatDate = this.formatDate;
|
275
|
+
state.defaults = {
|
276
|
+
minTime: this.config.minTime && state.formatDate(this.config.minTime, "H:i"),
|
277
|
+
maxTime: this.config.maxTime && state.formatDate(this.config.maxTime, "H:i")
|
278
|
+
};
|
279
|
+
},
|
280
|
+
onChange: function () {
|
281
|
+
var latest = this.latestSelectedDateObj;
|
282
|
+
var matchingTimeLimit = latest && findDateTimeLimit(latest);
|
283
|
+
if (latest && matchingTimeLimit !== undefined) {
|
284
|
+
this.set(matchingTimeLimit);
|
285
|
+
fp.config.minTime.setFullYear(latest.getFullYear());
|
286
|
+
fp.config.maxTime.setFullYear(latest.getFullYear());
|
287
|
+
fp.config.minTime.setMonth(latest.getMonth());
|
288
|
+
fp.config.maxTime.setMonth(latest.getMonth());
|
289
|
+
fp.config.minTime.setDate(latest.getDate());
|
290
|
+
fp.config.maxTime.setDate(latest.getDate());
|
291
|
+
if (compareDates(latest, fp.config.maxTime, false) > 0) {
|
292
|
+
fp.setDate(new Date(latest.getTime()).setHours(fp.config.maxTime.getHours(), fp.config.maxTime.getMinutes(), fp.config.maxTime.getSeconds(), fp.config.maxTime.getMilliseconds()), false);
|
293
|
+
}
|
294
|
+
else if (compareDates(latest, fp.config.minTime, false) < 0)
|
295
|
+
fp.setDate(new Date(latest.getTime()).setHours(fp.config.minTime.getHours(), fp.config.minTime.getMinutes(), fp.config.minTime.getSeconds(), fp.config.minTime.getMilliseconds()), false);
|
296
|
+
}
|
297
|
+
else {
|
298
|
+
var newMinMax = state.defaults || {
|
299
|
+
minTime: undefined,
|
300
|
+
maxTime: undefined
|
301
|
+
};
|
302
|
+
this.set(newMinMax);
|
303
|
+
if (!latest)
|
304
|
+
return;
|
305
|
+
var _a = fp.config, minTime = _a.minTime, maxTime = _a.maxTime;
|
306
|
+
if (minTime && compareTimes(latest, minTime) < 0) {
|
307
|
+
fp.setDate(new Date(latest.getTime()).setHours(minTime.getHours(), minTime.getMinutes(), minTime.getSeconds(), minTime.getMilliseconds()), false);
|
308
|
+
}
|
309
|
+
else if (maxTime && compareTimes(latest, maxTime) > 0) {
|
310
|
+
fp.setDate(new Date(latest.getTime()).setHours(maxTime.getHours(), maxTime.getMinutes(), maxTime.getSeconds(), maxTime.getMilliseconds()));
|
311
|
+
}
|
312
|
+
//
|
313
|
+
}
|
283
314
|
}
|
284
|
-
|
285
|
-
}
|
286
|
-
};
|
315
|
+
};
|
287
316
|
};
|
288
|
-
|
317
|
+
}
|
289
318
|
|
290
|
-
|
319
|
+
return minMaxTimePlugin;
|
291
320
|
|
292
|
-
}))
|
321
|
+
}));
|