@mui/x-date-pickers 7.0.0-alpha.6 → 7.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdapterDateFns/AdapterDateFns.d.ts +4 -21
- package/AdapterDateFns/AdapterDateFns.js +11 -255
- package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +62 -0
- package/AdapterDateFnsBase/AdapterDateFnsBase.js +291 -0
- package/AdapterDateFnsBase/index.d.ts +1 -0
- package/AdapterDateFnsBase/index.js +1 -0
- package/AdapterDateFnsBase/package.json +6 -0
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +1 -0
- package/AdapterDateFnsV3/AdapterDateFnsV3.d.ts +80 -0
- package/AdapterDateFnsV3/AdapterDateFnsV3.js +287 -0
- package/AdapterDateFnsV3/index.d.ts +1 -0
- package/AdapterDateFnsV3/index.js +1 -0
- package/AdapterDateFnsV3/package.json +6 -0
- package/CHANGELOG.md +357 -49
- package/DateCalendar/DateCalendar.js +6 -4
- package/DateCalendar/DateCalendar.types.d.ts +0 -8
- package/DatePicker/DatePickerToolbar.d.ts +2 -2
- package/DatePicker/DatePickerToolbar.js +2 -7
- package/DigitalClock/DigitalClock.js +4 -2
- package/DigitalClock/DigitalClock.types.d.ts +5 -0
- package/LocalizationProvider/LocalizationProvider.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -13
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +5 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +4 -8
- package/PickersSectionList/PickersSectionList.js +1 -1
- package/TimeClock/TimeClock.js +4 -2
- package/TimeClock/TimeClock.types.d.ts +5 -0
- package/hooks/useClearableField.js +3 -3
- package/index.js +1 -1
- package/internals/components/PickersInput/PickersFilledInput.js +2 -2
- package/internals/components/PickersInput/PickersInput.d.ts +2 -4
- package/internals/components/PickersInput/PickersInput.js +2 -3
- package/internals/components/PickersInput/PickersStandardInput.js +2 -2
- package/internals/hooks/useField/useField.utils.js +5 -5
- package/internals/hooks/usePicker/index.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerValue.js +2 -2
- package/internals/hooks/useUtils.js +2 -2
- package/internals/hooks/useViews.d.ts +4 -4
- package/internals/hooks/useViews.js +15 -15
- package/internals/index.d.ts +9 -3
- package/internals/index.js +6 -2
- package/internals/models/common.d.ts +1 -1
- package/internals/models/helpers.d.ts +1 -0
- package/internals/models/props/clock.d.ts +0 -9
- package/internals/utils/views.js +1 -1
- package/legacy/AdapterDateFns/AdapterDateFns.js +222 -458
- package/legacy/AdapterDateFnsBase/AdapterDateFnsBase.js +293 -0
- package/legacy/AdapterDateFnsBase/index.js +1 -0
- package/legacy/AdapterDateFnsV3/AdapterDateFnsV3.js +306 -0
- package/legacy/AdapterDateFnsV3/index.js +1 -0
- package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +5 -6
- package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +5 -6
- package/legacy/DateCalendar/DateCalendar.js +6 -4
- package/legacy/DatePicker/DatePickerToolbar.js +2 -7
- package/legacy/DigitalClock/DigitalClock.js +4 -2
- package/legacy/LocalizationProvider/LocalizationProvider.js +1 -1
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -13
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +4 -8
- package/legacy/PickersSectionList/PickersSectionList.js +1 -1
- package/legacy/TimeClock/TimeClock.js +4 -2
- package/legacy/hooks/useClearableField.js +3 -3
- package/legacy/index.js +1 -1
- package/legacy/internals/components/PickersInput/PickersFilledInput.js +2 -2
- package/legacy/internals/components/PickersInput/PickersInput.js +2 -3
- package/legacy/internals/components/PickersInput/PickersStandardInput.js +2 -2
- package/legacy/internals/hooks/useField/useField.utils.js +5 -5
- package/legacy/internals/hooks/usePicker/usePickerValue.js +2 -2
- package/legacy/internals/hooks/useUtils.js +2 -2
- package/legacy/internals/hooks/useViews.js +15 -15
- package/legacy/internals/index.js +6 -2
- package/legacy/internals/utils/views.js +1 -1
- package/legacy/locales/index.js +1 -0
- package/locales/enUS.d.ts +1 -1
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/mk.d.ts +1 -1
- package/locales/utils/getPickersLocalization.d.ts +1 -1
- package/modern/AdapterDateFns/AdapterDateFns.js +11 -254
- package/modern/AdapterDateFnsBase/AdapterDateFnsBase.js +290 -0
- package/modern/AdapterDateFnsBase/index.js +1 -0
- package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +287 -0
- package/modern/AdapterDateFnsV3/index.js +1 -0
- package/modern/DateCalendar/DateCalendar.js +6 -4
- package/modern/DatePicker/DatePickerToolbar.js +2 -7
- package/modern/DigitalClock/DigitalClock.js +4 -2
- package/modern/LocalizationProvider/LocalizationProvider.js +1 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -13
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +4 -8
- package/modern/PickersSectionList/PickersSectionList.js +1 -1
- package/modern/TimeClock/TimeClock.js +4 -2
- package/modern/hooks/useClearableField.js +3 -3
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersInput/PickersFilledInput.js +2 -2
- package/modern/internals/components/PickersInput/PickersInput.js +2 -3
- package/modern/internals/components/PickersInput/PickersStandardInput.js +2 -2
- package/modern/internals/hooks/useField/useField.utils.js +5 -5
- package/modern/internals/hooks/usePicker/usePickerValue.js +2 -2
- package/modern/internals/hooks/useUtils.js +2 -2
- package/modern/internals/hooks/useViews.js +15 -15
- package/modern/internals/index.js +6 -2
- package/modern/internals/utils/views.js +1 -1
- package/modern/locales/index.js +1 -0
- package/node/AdapterDateFns/AdapterDateFns.js +11 -254
- package/node/AdapterDateFnsBase/AdapterDateFnsBase.js +298 -0
- package/node/AdapterDateFnsBase/index.js +12 -0
- package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +295 -0
- package/node/AdapterDateFnsV3/index.js +12 -0
- package/node/DateCalendar/DateCalendar.js +6 -4
- package/node/DatePicker/DatePickerToolbar.js +0 -4
- package/node/DigitalClock/DigitalClock.js +4 -2
- package/node/LocalizationProvider/LocalizationProvider.js +1 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -13
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +4 -8
- package/node/PickersSectionList/PickersSectionList.js +1 -1
- package/node/TimeClock/TimeClock.js +4 -2
- package/node/hooks/useClearableField.js +3 -3
- package/node/index.js +1 -1
- package/node/internals/components/PickersInput/PickersFilledInput.js +2 -2
- package/node/internals/components/PickersInput/PickersInput.js +2 -3
- package/node/internals/components/PickersInput/PickersStandardInput.js +2 -2
- package/node/internals/hooks/useField/useField.utils.js +5 -5
- package/node/internals/hooks/usePicker/usePickerValue.js +2 -2
- package/node/internals/hooks/useUtils.js +2 -2
- package/node/internals/hooks/useViews.js +15 -15
- package/node/internals/index.js +47 -1
- package/node/internals/utils/views.js +1 -1
- package/node/locales/index.js +11 -0
- package/package.json +6 -6
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
5
9
|
/* eslint-disable class-methods-use-this */
|
|
6
10
|
import addDays from 'date-fns/addDays';
|
|
7
11
|
import addSeconds from 'date-fns/addSeconds';
|
|
@@ -48,196 +52,7 @@ import isWithinInterval from 'date-fns/isWithinInterval';
|
|
|
48
52
|
import defaultLocale from 'date-fns/locale/en-US';
|
|
49
53
|
// @ts-ignore
|
|
50
54
|
import longFormatters from 'date-fns/_lib/format/longFormatters';
|
|
51
|
-
|
|
52
|
-
// Year
|
|
53
|
-
y: {
|
|
54
|
-
sectionType: 'year',
|
|
55
|
-
contentType: 'digit',
|
|
56
|
-
maxLength: 4
|
|
57
|
-
},
|
|
58
|
-
yy: 'year',
|
|
59
|
-
yyy: {
|
|
60
|
-
sectionType: 'year',
|
|
61
|
-
contentType: 'digit',
|
|
62
|
-
maxLength: 4
|
|
63
|
-
},
|
|
64
|
-
yyyy: 'year',
|
|
65
|
-
// Month
|
|
66
|
-
M: {
|
|
67
|
-
sectionType: 'month',
|
|
68
|
-
contentType: 'digit',
|
|
69
|
-
maxLength: 2
|
|
70
|
-
},
|
|
71
|
-
MM: 'month',
|
|
72
|
-
MMMM: {
|
|
73
|
-
sectionType: 'month',
|
|
74
|
-
contentType: 'letter'
|
|
75
|
-
},
|
|
76
|
-
MMM: {
|
|
77
|
-
sectionType: 'month',
|
|
78
|
-
contentType: 'letter'
|
|
79
|
-
},
|
|
80
|
-
L: {
|
|
81
|
-
sectionType: 'month',
|
|
82
|
-
contentType: 'digit',
|
|
83
|
-
maxLength: 2
|
|
84
|
-
},
|
|
85
|
-
LL: 'month',
|
|
86
|
-
LLL: {
|
|
87
|
-
sectionType: 'month',
|
|
88
|
-
contentType: 'letter'
|
|
89
|
-
},
|
|
90
|
-
LLLL: {
|
|
91
|
-
sectionType: 'month',
|
|
92
|
-
contentType: 'letter'
|
|
93
|
-
},
|
|
94
|
-
// Day of the month
|
|
95
|
-
d: {
|
|
96
|
-
sectionType: 'day',
|
|
97
|
-
contentType: 'digit',
|
|
98
|
-
maxLength: 2
|
|
99
|
-
},
|
|
100
|
-
dd: 'day',
|
|
101
|
-
do: {
|
|
102
|
-
sectionType: 'day',
|
|
103
|
-
contentType: 'digit-with-letter'
|
|
104
|
-
},
|
|
105
|
-
// Day of the week
|
|
106
|
-
E: {
|
|
107
|
-
sectionType: 'weekDay',
|
|
108
|
-
contentType: 'letter'
|
|
109
|
-
},
|
|
110
|
-
EE: {
|
|
111
|
-
sectionType: 'weekDay',
|
|
112
|
-
contentType: 'letter'
|
|
113
|
-
},
|
|
114
|
-
EEE: {
|
|
115
|
-
sectionType: 'weekDay',
|
|
116
|
-
contentType: 'letter'
|
|
117
|
-
},
|
|
118
|
-
EEEE: {
|
|
119
|
-
sectionType: 'weekDay',
|
|
120
|
-
contentType: 'letter'
|
|
121
|
-
},
|
|
122
|
-
EEEEE: {
|
|
123
|
-
sectionType: 'weekDay',
|
|
124
|
-
contentType: 'letter'
|
|
125
|
-
},
|
|
126
|
-
i: {
|
|
127
|
-
sectionType: 'weekDay',
|
|
128
|
-
contentType: 'digit',
|
|
129
|
-
maxLength: 1
|
|
130
|
-
},
|
|
131
|
-
ii: 'weekDay',
|
|
132
|
-
iii: {
|
|
133
|
-
sectionType: 'weekDay',
|
|
134
|
-
contentType: 'letter'
|
|
135
|
-
},
|
|
136
|
-
iiii: {
|
|
137
|
-
sectionType: 'weekDay',
|
|
138
|
-
contentType: 'letter'
|
|
139
|
-
},
|
|
140
|
-
e: {
|
|
141
|
-
sectionType: 'weekDay',
|
|
142
|
-
contentType: 'digit',
|
|
143
|
-
maxLength: 1
|
|
144
|
-
},
|
|
145
|
-
ee: 'weekDay',
|
|
146
|
-
eee: {
|
|
147
|
-
sectionType: 'weekDay',
|
|
148
|
-
contentType: 'letter'
|
|
149
|
-
},
|
|
150
|
-
eeee: {
|
|
151
|
-
sectionType: 'weekDay',
|
|
152
|
-
contentType: 'letter'
|
|
153
|
-
},
|
|
154
|
-
eeeee: {
|
|
155
|
-
sectionType: 'weekDay',
|
|
156
|
-
contentType: 'letter'
|
|
157
|
-
},
|
|
158
|
-
eeeeee: {
|
|
159
|
-
sectionType: 'weekDay',
|
|
160
|
-
contentType: 'letter'
|
|
161
|
-
},
|
|
162
|
-
c: {
|
|
163
|
-
sectionType: 'weekDay',
|
|
164
|
-
contentType: 'digit',
|
|
165
|
-
maxLength: 1
|
|
166
|
-
},
|
|
167
|
-
cc: 'weekDay',
|
|
168
|
-
ccc: {
|
|
169
|
-
sectionType: 'weekDay',
|
|
170
|
-
contentType: 'letter'
|
|
171
|
-
},
|
|
172
|
-
cccc: {
|
|
173
|
-
sectionType: 'weekDay',
|
|
174
|
-
contentType: 'letter'
|
|
175
|
-
},
|
|
176
|
-
ccccc: {
|
|
177
|
-
sectionType: 'weekDay',
|
|
178
|
-
contentType: 'letter'
|
|
179
|
-
},
|
|
180
|
-
cccccc: {
|
|
181
|
-
sectionType: 'weekDay',
|
|
182
|
-
contentType: 'letter'
|
|
183
|
-
},
|
|
184
|
-
// Meridiem
|
|
185
|
-
a: 'meridiem',
|
|
186
|
-
aa: 'meridiem',
|
|
187
|
-
aaa: 'meridiem',
|
|
188
|
-
// Hours
|
|
189
|
-
H: {
|
|
190
|
-
sectionType: 'hours',
|
|
191
|
-
contentType: 'digit',
|
|
192
|
-
maxLength: 2
|
|
193
|
-
},
|
|
194
|
-
HH: 'hours',
|
|
195
|
-
h: {
|
|
196
|
-
sectionType: 'hours',
|
|
197
|
-
contentType: 'digit',
|
|
198
|
-
maxLength: 2
|
|
199
|
-
},
|
|
200
|
-
hh: 'hours',
|
|
201
|
-
// Minutes
|
|
202
|
-
m: {
|
|
203
|
-
sectionType: 'minutes',
|
|
204
|
-
contentType: 'digit',
|
|
205
|
-
maxLength: 2
|
|
206
|
-
},
|
|
207
|
-
mm: 'minutes',
|
|
208
|
-
// Seconds
|
|
209
|
-
s: {
|
|
210
|
-
sectionType: 'seconds',
|
|
211
|
-
contentType: 'digit',
|
|
212
|
-
maxLength: 2
|
|
213
|
-
},
|
|
214
|
-
ss: 'seconds'
|
|
215
|
-
};
|
|
216
|
-
var defaultFormats = {
|
|
217
|
-
year: 'yyyy',
|
|
218
|
-
month: 'LLLL',
|
|
219
|
-
monthShort: 'MMM',
|
|
220
|
-
dayOfMonth: 'd',
|
|
221
|
-
weekday: 'EEEE',
|
|
222
|
-
weekdayShort: 'EEEEEE',
|
|
223
|
-
hours24h: 'HH',
|
|
224
|
-
hours12h: 'hh',
|
|
225
|
-
meridiem: 'aa',
|
|
226
|
-
minutes: 'mm',
|
|
227
|
-
seconds: 'ss',
|
|
228
|
-
fullDate: 'PP',
|
|
229
|
-
keyboardDate: 'P',
|
|
230
|
-
shortDate: 'MMM d',
|
|
231
|
-
normalDate: 'd MMMM',
|
|
232
|
-
normalDateWithWeekday: 'EEE, MMM d',
|
|
233
|
-
fullTime: 'p',
|
|
234
|
-
fullTime12h: 'hh:mm aa',
|
|
235
|
-
fullTime24h: 'HH:mm',
|
|
236
|
-
keyboardDateTime: 'P p',
|
|
237
|
-
keyboardDateTime12h: 'P hh:mm aa',
|
|
238
|
-
keyboardDateTime24h: 'P HH:mm'
|
|
239
|
-
};
|
|
240
|
-
|
|
55
|
+
import { AdapterDateFnsBase } from '../AdapterDateFnsBase';
|
|
241
56
|
/**
|
|
242
57
|
* Based on `@date-io/date-fns`
|
|
243
58
|
*
|
|
@@ -263,272 +78,221 @@ var defaultFormats = {
|
|
|
263
78
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
264
79
|
* SOFTWARE.
|
|
265
80
|
*/
|
|
266
|
-
export var AdapterDateFns = /*#__PURE__*/
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
this.formats = void 0;
|
|
277
|
-
this.formatTokenMap = formatTokenMap;
|
|
278
|
-
this.escapedCharacters = {
|
|
279
|
-
start: "'",
|
|
280
|
-
end: "'"
|
|
281
|
-
};
|
|
282
|
-
this.date = function (value) {
|
|
283
|
-
if (typeof value === 'undefined') {
|
|
284
|
-
return new Date();
|
|
81
|
+
export var AdapterDateFns = /*#__PURE__*/function (_ref) {
|
|
82
|
+
_inherits(AdapterDateFns, _ref);
|
|
83
|
+
function AdapterDateFns() {
|
|
84
|
+
var _this;
|
|
85
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
86
|
+
locale = _ref2.locale,
|
|
87
|
+
formats = _ref2.formats;
|
|
88
|
+
_classCallCheck(this, AdapterDateFns);
|
|
89
|
+
if (typeof addDays !== 'function') {
|
|
90
|
+
throw new Error(['MUI: The `date-fns` package v3.x is not compatible with this adapter.', 'Please, install v2.x of the package or use the `AdapterDateFnsV3` instead.'].join('\n'));
|
|
285
91
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
this.getTimezone = function () {
|
|
295
|
-
return 'default';
|
|
296
|
-
};
|
|
297
|
-
this.setTimezone = function (value) {
|
|
298
|
-
return value;
|
|
299
|
-
};
|
|
300
|
-
this.toJsDate = function (value) {
|
|
301
|
-
return value;
|
|
302
|
-
};
|
|
303
|
-
this.parse = function (value, format) {
|
|
304
|
-
if (value === '') {
|
|
305
|
-
return null;
|
|
306
|
-
}
|
|
307
|
-
return dateFnsParse(value, format, new Date(), {
|
|
308
|
-
locale: _this.locale
|
|
309
|
-
});
|
|
310
|
-
};
|
|
311
|
-
this.getCurrentLocaleCode = function () {
|
|
312
|
-
var _this$locale;
|
|
313
|
-
return ((_this$locale = _this.locale) == null ? void 0 : _this$locale.code) || 'en-US';
|
|
314
|
-
};
|
|
315
|
-
// Note: date-fns input types are more lenient than this adapter, so we need to expose our more
|
|
316
|
-
// strict signature and delegate to the more lenient signature. Otherwise, we have downstream type errors upon usage.
|
|
317
|
-
this.is12HourCycleInCurrentLocale = function () {
|
|
318
|
-
if (_this.locale) {
|
|
319
|
-
return /a/.test(_this.locale.formatLong.time());
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
// By default, date-fns is using en-US locale with am/pm enabled
|
|
323
|
-
return true;
|
|
324
|
-
};
|
|
325
|
-
this.expandFormat = function (format) {
|
|
326
|
-
var longFormatRegexp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
327
|
-
|
|
328
|
-
// @see https://github.com/date-fns/date-fns/blob/master/src/format/index.js#L31
|
|
329
|
-
return format.match(longFormatRegexp).map(function (token) {
|
|
330
|
-
var firstCharacter = token[0];
|
|
331
|
-
if (firstCharacter === 'p' || firstCharacter === 'P') {
|
|
332
|
-
var longFormatter = longFormatters[firstCharacter];
|
|
333
|
-
var locale = _this.locale || defaultLocale;
|
|
334
|
-
return longFormatter(token, locale.formatLong, {});
|
|
92
|
+
_this = _callSuper(this, AdapterDateFns, [{
|
|
93
|
+
locale: locale != null ? locale : defaultLocale,
|
|
94
|
+
formats: formats,
|
|
95
|
+
longFormatters: longFormatters
|
|
96
|
+
}]);
|
|
97
|
+
_this.parse = function (value, format) {
|
|
98
|
+
if (value === '') {
|
|
99
|
+
return null;
|
|
335
100
|
}
|
|
336
|
-
return
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
return
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
return
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
});
|
|
101
|
+
return dateFnsParse(value, format, new Date(), {
|
|
102
|
+
locale: _this.locale
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
_this.isValid = function (value) {
|
|
106
|
+
if (value == null) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return isValid(value);
|
|
110
|
+
};
|
|
111
|
+
_this.format = function (value, formatKey) {
|
|
112
|
+
return _this.formatByString(value, _this.formats[formatKey]);
|
|
113
|
+
};
|
|
114
|
+
_this.formatByString = function (value, formatString) {
|
|
115
|
+
return dateFnsFormat(value, formatString, {
|
|
116
|
+
locale: _this.locale
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
_this.isEqual = function (value, comparing) {
|
|
120
|
+
if (value === null && comparing === null) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
if (value === null || comparing === null) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
return isEqual(value, comparing);
|
|
127
|
+
};
|
|
128
|
+
_this.isSameYear = function (value, comparing) {
|
|
129
|
+
return isSameYear(value, comparing);
|
|
130
|
+
};
|
|
131
|
+
_this.isSameMonth = function (value, comparing) {
|
|
132
|
+
return isSameMonth(value, comparing);
|
|
133
|
+
};
|
|
134
|
+
_this.isSameDay = function (value, comparing) {
|
|
135
|
+
return isSameDay(value, comparing);
|
|
136
|
+
};
|
|
137
|
+
_this.isSameHour = function (value, comparing) {
|
|
138
|
+
return isSameHour(value, comparing);
|
|
139
|
+
};
|
|
140
|
+
_this.isAfter = function (value, comparing) {
|
|
141
|
+
return isAfter(value, comparing);
|
|
142
|
+
};
|
|
143
|
+
_this.isAfterYear = function (value, comparing) {
|
|
144
|
+
return isAfter(value, endOfYear(comparing));
|
|
145
|
+
};
|
|
146
|
+
_this.isAfterDay = function (value, comparing) {
|
|
147
|
+
return isAfter(value, endOfDay(comparing));
|
|
148
|
+
};
|
|
149
|
+
_this.isBefore = function (value, comparing) {
|
|
150
|
+
return isBefore(value, comparing);
|
|
151
|
+
};
|
|
152
|
+
_this.isBeforeYear = function (value, comparing) {
|
|
153
|
+
return isBefore(value, _this.startOfYear(comparing));
|
|
154
|
+
};
|
|
155
|
+
_this.isBeforeDay = function (value, comparing) {
|
|
156
|
+
return isBefore(value, _this.startOfDay(comparing));
|
|
157
|
+
};
|
|
158
|
+
_this.isWithinRange = function (value, _ref3) {
|
|
159
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
160
|
+
start = _ref4[0],
|
|
161
|
+
end = _ref4[1];
|
|
162
|
+
return isWithinInterval(value, {
|
|
163
|
+
start: start,
|
|
164
|
+
end: end
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
_this.startOfYear = function (value) {
|
|
168
|
+
return startOfYear(value);
|
|
169
|
+
};
|
|
170
|
+
_this.startOfMonth = function (value) {
|
|
171
|
+
return startOfMonth(value);
|
|
172
|
+
};
|
|
173
|
+
_this.startOfWeek = function (value) {
|
|
174
|
+
return startOfWeek(value, {
|
|
175
|
+
locale: _this.locale
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
_this.startOfDay = function (value) {
|
|
179
|
+
return startOfDay(value);
|
|
180
|
+
};
|
|
181
|
+
_this.endOfYear = function (value) {
|
|
182
|
+
return endOfYear(value);
|
|
183
|
+
};
|
|
184
|
+
_this.endOfMonth = function (value) {
|
|
185
|
+
return endOfMonth(value);
|
|
186
|
+
};
|
|
187
|
+
_this.endOfWeek = function (value) {
|
|
188
|
+
return endOfWeek(value, {
|
|
189
|
+
locale: _this.locale
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
_this.endOfDay = function (value) {
|
|
193
|
+
return endOfDay(value);
|
|
194
|
+
};
|
|
195
|
+
_this.addYears = function (value, amount) {
|
|
196
|
+
return addYears(value, amount);
|
|
197
|
+
};
|
|
198
|
+
_this.addMonths = function (value, amount) {
|
|
199
|
+
return addMonths(value, amount);
|
|
200
|
+
};
|
|
201
|
+
_this.addWeeks = function (value, amount) {
|
|
202
|
+
return addWeeks(value, amount);
|
|
203
|
+
};
|
|
204
|
+
_this.addDays = function (value, amount) {
|
|
205
|
+
return addDays(value, amount);
|
|
206
|
+
};
|
|
207
|
+
_this.addHours = function (value, amount) {
|
|
208
|
+
return addHours(value, amount);
|
|
209
|
+
};
|
|
210
|
+
_this.addMinutes = function (value, amount) {
|
|
211
|
+
return addMinutes(value, amount);
|
|
212
|
+
};
|
|
213
|
+
_this.addSeconds = function (value, amount) {
|
|
214
|
+
return addSeconds(value, amount);
|
|
215
|
+
};
|
|
216
|
+
_this.getYear = function (value) {
|
|
217
|
+
return getYear(value);
|
|
218
|
+
};
|
|
219
|
+
_this.getMonth = function (value) {
|
|
220
|
+
return getMonth(value);
|
|
221
|
+
};
|
|
222
|
+
_this.getDate = function (value) {
|
|
223
|
+
return getDate(value);
|
|
224
|
+
};
|
|
225
|
+
_this.getHours = function (value) {
|
|
226
|
+
return getHours(value);
|
|
227
|
+
};
|
|
228
|
+
_this.getMinutes = function (value) {
|
|
229
|
+
return getMinutes(value);
|
|
230
|
+
};
|
|
231
|
+
_this.getSeconds = function (value) {
|
|
232
|
+
return getSeconds(value);
|
|
233
|
+
};
|
|
234
|
+
_this.getMilliseconds = function (value) {
|
|
235
|
+
return getMilliseconds(value);
|
|
236
|
+
};
|
|
237
|
+
_this.setYear = function (value, year) {
|
|
238
|
+
return setYear(value, year);
|
|
239
|
+
};
|
|
240
|
+
_this.setMonth = function (value, month) {
|
|
241
|
+
return setMonth(value, month);
|
|
242
|
+
};
|
|
243
|
+
_this.setDate = function (value, date) {
|
|
244
|
+
return setDate(value, date);
|
|
245
|
+
};
|
|
246
|
+
_this.setHours = function (value, hours) {
|
|
247
|
+
return setHours(value, hours);
|
|
248
|
+
};
|
|
249
|
+
_this.setMinutes = function (value, minutes) {
|
|
250
|
+
return setMinutes(value, minutes);
|
|
251
|
+
};
|
|
252
|
+
_this.setSeconds = function (value, seconds) {
|
|
253
|
+
return setSeconds(value, seconds);
|
|
254
|
+
};
|
|
255
|
+
_this.setMilliseconds = function (value, milliseconds) {
|
|
256
|
+
return setMilliseconds(value, milliseconds);
|
|
257
|
+
};
|
|
258
|
+
_this.getDaysInMonth = function (value) {
|
|
259
|
+
return getDaysInMonth(value);
|
|
260
|
+
};
|
|
261
|
+
_this.getWeekArray = function (value) {
|
|
262
|
+
var start = _this.startOfWeek(_this.startOfMonth(value));
|
|
263
|
+
var end = _this.endOfWeek(_this.endOfMonth(value));
|
|
264
|
+
var count = 0;
|
|
265
|
+
var current = start;
|
|
266
|
+
var nestedWeeks = [];
|
|
267
|
+
while (_this.isBefore(current, end)) {
|
|
268
|
+
var weekNumber = Math.floor(count / 7);
|
|
269
|
+
nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
|
|
270
|
+
nestedWeeks[weekNumber].push(current);
|
|
271
|
+
current = _this.addDays(current, 1);
|
|
272
|
+
count += 1;
|
|
273
|
+
}
|
|
274
|
+
return nestedWeeks;
|
|
275
|
+
};
|
|
276
|
+
_this.getWeekNumber = function (value) {
|
|
277
|
+
return getWeek(value, {
|
|
278
|
+
locale: _this.locale
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
_this.getYearRange = function (_ref5) {
|
|
282
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
283
|
+
start = _ref6[0],
|
|
284
|
+
end = _ref6[1];
|
|
285
|
+
var startDate = _this.startOfYear(start);
|
|
286
|
+
var endDate = _this.endOfYear(end);
|
|
287
|
+
var years = [];
|
|
288
|
+
var current = startDate;
|
|
289
|
+
while (_this.isBefore(current, endDate)) {
|
|
290
|
+
years.push(current);
|
|
291
|
+
current = _this.addYears(current, 1);
|
|
292
|
+
}
|
|
293
|
+
return years;
|
|
294
|
+
};
|
|
295
|
+
return _this;
|
|
296
|
+
}
|
|
297
|
+
return _createClass(AdapterDateFns);
|
|
298
|
+
}(AdapterDateFnsBase);
|