@mui/x-date-pickers 8.10.0 → 8.10.2
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.js +194 -193
- package/AdapterDateFnsBase/AdapterDateFnsBase.js +57 -60
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +197 -196
- package/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js +195 -195
- package/AdapterDateFnsV2/AdapterDateFnsV2.js +192 -192
- package/AdapterDayjs/AdapterDayjs.js +378 -378
- package/AdapterLuxon/AdapterLuxon.js +324 -324
- package/AdapterMoment/AdapterMoment.js +297 -300
- package/AdapterMomentHijri/AdapterMomentHijri.js +78 -77
- package/AdapterMomentJalaali/AdapterMomentJalaali.js +78 -79
- package/CHANGELOG.md +182 -0
- package/esm/AdapterDateFns/AdapterDateFns.js +194 -193
- package/esm/AdapterDateFnsBase/AdapterDateFnsBase.js +57 -60
- package/esm/AdapterDateFnsJalali/AdapterDateFnsJalali.js +197 -196
- package/esm/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js +195 -195
- package/esm/AdapterDateFnsV2/AdapterDateFnsV2.js +192 -192
- package/esm/AdapterDayjs/AdapterDayjs.js +378 -378
- package/esm/AdapterLuxon/AdapterLuxon.js +324 -324
- package/esm/AdapterMoment/AdapterMoment.js +297 -300
- package/esm/AdapterMomentHijri/AdapterMomentHijri.js +78 -77
- package/esm/AdapterMomentJalaali/AdapterMomentJalaali.js +78 -79
- package/esm/index.js +1 -1
- package/index.js +1 -1
- package/package.json +7 -8
|
@@ -135,202 +135,203 @@ class AdapterDateFnsJalali extends _AdapterDateFnsBase.AdapterDateFnsBase {
|
|
|
135
135
|
longFormatters: _format.longFormatters,
|
|
136
136
|
lib: 'date-fns-jalali'
|
|
137
137
|
});
|
|
138
|
-
// TODO: explicit return types can be removed once there is only one date-fns version supported
|
|
139
|
-
this.parse = (value, format) => {
|
|
140
|
-
if (value === '') {
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
return (0, _parse.parse)(value, format, new Date(), {
|
|
144
|
-
locale: this.locale
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
|
-
this.isValid = value => {
|
|
148
|
-
if (value == null) {
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
return (0, _isValid.isValid)(value);
|
|
152
|
-
};
|
|
153
|
-
this.format = (value, formatKey) => {
|
|
154
|
-
return this.formatByString(value, this.formats[formatKey]);
|
|
155
|
-
};
|
|
156
|
-
this.formatByString = (value, formatString) => {
|
|
157
|
-
return (0, _format.format)(value, formatString, {
|
|
158
|
-
locale: this.locale
|
|
159
|
-
});
|
|
160
|
-
};
|
|
161
|
-
this.formatNumber = numberToFormat => {
|
|
162
|
-
return numberToFormat.replace(/\d/g, match => NUMBER_SYMBOL_MAP[match]).replace(/,/g, '،');
|
|
163
|
-
};
|
|
164
|
-
this.isEqual = (value, comparing) => {
|
|
165
|
-
if (value === null && comparing === null) {
|
|
166
|
-
return true;
|
|
167
|
-
}
|
|
168
|
-
if (value === null || comparing === null) {
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
return (0, _isEqual.isEqual)(value, comparing);
|
|
172
|
-
};
|
|
173
|
-
this.isSameYear = (value, comparing) => {
|
|
174
|
-
return (0, _isSameYear.isSameYear)(value, comparing);
|
|
175
|
-
};
|
|
176
|
-
this.isSameMonth = (value, comparing) => {
|
|
177
|
-
return (0, _isSameMonth.isSameMonth)(value, comparing);
|
|
178
|
-
};
|
|
179
|
-
this.isSameDay = (value, comparing) => {
|
|
180
|
-
return (0, _isSameDay.isSameDay)(value, comparing);
|
|
181
|
-
};
|
|
182
|
-
this.isSameHour = (value, comparing) => {
|
|
183
|
-
return (0, _isSameHour.isSameHour)(value, comparing);
|
|
184
|
-
};
|
|
185
|
-
this.isAfter = (value, comparing) => {
|
|
186
|
-
return (0, _isAfter.isAfter)(value, comparing);
|
|
187
|
-
};
|
|
188
|
-
this.isAfterYear = (value, comparing) => {
|
|
189
|
-
return (0, _isAfter.isAfter)(value, this.endOfYear(comparing));
|
|
190
|
-
};
|
|
191
|
-
this.isAfterDay = (value, comparing) => {
|
|
192
|
-
return (0, _isAfter.isAfter)(value, this.endOfDay(comparing));
|
|
193
|
-
};
|
|
194
|
-
this.isBefore = (value, comparing) => {
|
|
195
|
-
return (0, _isBefore.isBefore)(value, comparing);
|
|
196
|
-
};
|
|
197
|
-
this.isBeforeYear = (value, comparing) => {
|
|
198
|
-
return (0, _isBefore.isBefore)(value, this.startOfYear(comparing));
|
|
199
|
-
};
|
|
200
|
-
this.isBeforeDay = (value, comparing) => {
|
|
201
|
-
return (0, _isBefore.isBefore)(value, this.startOfDay(comparing));
|
|
202
|
-
};
|
|
203
|
-
this.isWithinRange = (value, [start, end]) => {
|
|
204
|
-
return (0, _isWithinInterval.isWithinInterval)(value, {
|
|
205
|
-
start,
|
|
206
|
-
end
|
|
207
|
-
});
|
|
208
|
-
};
|
|
209
|
-
this.startOfYear = value => {
|
|
210
|
-
return (0, _startOfYear.startOfYear)(value);
|
|
211
|
-
};
|
|
212
|
-
this.startOfMonth = value => {
|
|
213
|
-
return (0, _startOfMonth.startOfMonth)(value);
|
|
214
|
-
};
|
|
215
|
-
this.startOfWeek = value => {
|
|
216
|
-
return (0, _startOfWeek.startOfWeek)(value, {
|
|
217
|
-
locale: this.locale
|
|
218
|
-
});
|
|
219
|
-
};
|
|
220
|
-
this.startOfDay = value => {
|
|
221
|
-
return (0, _startOfDay.startOfDay)(value);
|
|
222
|
-
};
|
|
223
|
-
this.endOfYear = value => {
|
|
224
|
-
return (0, _endOfYear.endOfYear)(value);
|
|
225
|
-
};
|
|
226
|
-
this.endOfMonth = value => {
|
|
227
|
-
return (0, _endOfMonth.endOfMonth)(value);
|
|
228
|
-
};
|
|
229
|
-
this.endOfWeek = value => {
|
|
230
|
-
return (0, _endOfWeek.endOfWeek)(value, {
|
|
231
|
-
locale: this.locale
|
|
232
|
-
});
|
|
233
|
-
};
|
|
234
|
-
this.endOfDay = value => {
|
|
235
|
-
return (0, _endOfDay.endOfDay)(value);
|
|
236
|
-
};
|
|
237
|
-
this.addYears = (value, amount) => {
|
|
238
|
-
return (0, _addYears.addYears)(value, amount);
|
|
239
|
-
};
|
|
240
|
-
this.addMonths = (value, amount) => {
|
|
241
|
-
return (0, _addMonths.addMonths)(value, amount);
|
|
242
|
-
};
|
|
243
|
-
this.addWeeks = (value, amount) => {
|
|
244
|
-
return (0, _addWeeks.addWeeks)(value, amount);
|
|
245
|
-
};
|
|
246
|
-
this.addDays = (value, amount) => {
|
|
247
|
-
return (0, _addDays.addDays)(value, amount);
|
|
248
|
-
};
|
|
249
|
-
this.addHours = (value, amount) => {
|
|
250
|
-
return (0, _addHours.addHours)(value, amount);
|
|
251
|
-
};
|
|
252
|
-
this.addMinutes = (value, amount) => {
|
|
253
|
-
return (0, _addMinutes.addMinutes)(value, amount);
|
|
254
|
-
};
|
|
255
|
-
this.addSeconds = (value, amount) => {
|
|
256
|
-
return (0, _addSeconds.addSeconds)(value, amount);
|
|
257
|
-
};
|
|
258
|
-
this.getYear = value => {
|
|
259
|
-
return (0, _getYear.getYear)(value);
|
|
260
|
-
};
|
|
261
|
-
this.getMonth = value => {
|
|
262
|
-
return (0, _getMonth.getMonth)(value);
|
|
263
|
-
};
|
|
264
|
-
this.getDate = value => {
|
|
265
|
-
return (0, _getDate.getDate)(value);
|
|
266
|
-
};
|
|
267
|
-
this.getHours = value => {
|
|
268
|
-
return (0, _getHours.getHours)(value);
|
|
269
|
-
};
|
|
270
|
-
this.getMinutes = value => {
|
|
271
|
-
return (0, _getMinutes.getMinutes)(value);
|
|
272
|
-
};
|
|
273
|
-
this.getSeconds = value => {
|
|
274
|
-
return (0, _getSeconds.getSeconds)(value);
|
|
275
|
-
};
|
|
276
|
-
this.getMilliseconds = value => {
|
|
277
|
-
return (0, _getMilliseconds.getMilliseconds)(value);
|
|
278
|
-
};
|
|
279
|
-
this.setYear = (value, year) => {
|
|
280
|
-
return (0, _setYear.setYear)(value, year);
|
|
281
|
-
};
|
|
282
|
-
this.setMonth = (value, month) => {
|
|
283
|
-
return (0, _setMonth.setMonth)(value, month);
|
|
284
|
-
};
|
|
285
|
-
this.setDate = (value, date) => {
|
|
286
|
-
return (0, _setDate.setDate)(value, date);
|
|
287
|
-
};
|
|
288
|
-
this.setHours = (value, hours) => {
|
|
289
|
-
return (0, _setHours.setHours)(value, hours);
|
|
290
|
-
};
|
|
291
|
-
this.setMinutes = (value, minutes) => {
|
|
292
|
-
return (0, _setMinutes.setMinutes)(value, minutes);
|
|
293
|
-
};
|
|
294
|
-
this.setSeconds = (value, seconds) => {
|
|
295
|
-
return (0, _setSeconds.setSeconds)(value, seconds);
|
|
296
|
-
};
|
|
297
|
-
this.setMilliseconds = (value, milliseconds) => {
|
|
298
|
-
return (0, _setMilliseconds.setMilliseconds)(value, milliseconds);
|
|
299
|
-
};
|
|
300
|
-
this.getDaysInMonth = value => {
|
|
301
|
-
return (0, _getDaysInMonth.getDaysInMonth)(value);
|
|
302
|
-
};
|
|
303
|
-
this.getWeekArray = value => {
|
|
304
|
-
const start = this.startOfWeek(this.startOfMonth(value));
|
|
305
|
-
const end = this.endOfWeek(this.endOfMonth(value));
|
|
306
|
-
let count = 0;
|
|
307
|
-
let current = start;
|
|
308
|
-
const nestedWeeks = [];
|
|
309
|
-
while (this.isBefore(current, end)) {
|
|
310
|
-
const weekNumber = Math.floor(count / 7);
|
|
311
|
-
nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
|
|
312
|
-
nestedWeeks[weekNumber].push(current);
|
|
313
|
-
current = this.addDays(current, 1);
|
|
314
|
-
count += 1;
|
|
315
|
-
}
|
|
316
|
-
return nestedWeeks;
|
|
317
|
-
};
|
|
318
|
-
this.getWeekNumber = date => {
|
|
319
|
-
return (0, _getWeek.getWeek)(date, {
|
|
320
|
-
locale: this.locale
|
|
321
|
-
});
|
|
322
|
-
};
|
|
323
|
-
this.getYearRange = ([start, end]) => {
|
|
324
|
-
const startDate = this.startOfYear(start);
|
|
325
|
-
const endDate = this.endOfYear(end);
|
|
326
|
-
const years = [];
|
|
327
|
-
let current = startDate;
|
|
328
|
-
while (this.isBefore(current, endDate)) {
|
|
329
|
-
years.push(current);
|
|
330
|
-
current = this.addYears(current, 1);
|
|
331
|
-
}
|
|
332
|
-
return years;
|
|
333
|
-
};
|
|
334
138
|
}
|
|
139
|
+
|
|
140
|
+
// TODO: explicit return types can be removed once there is only one date-fns version supported
|
|
141
|
+
parse = (value, format) => {
|
|
142
|
+
if (value === '') {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
return (0, _parse.parse)(value, format, new Date(), {
|
|
146
|
+
locale: this.locale
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
isValid = value => {
|
|
150
|
+
if (value == null) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
return (0, _isValid.isValid)(value);
|
|
154
|
+
};
|
|
155
|
+
format = (value, formatKey) => {
|
|
156
|
+
return this.formatByString(value, this.formats[formatKey]);
|
|
157
|
+
};
|
|
158
|
+
formatByString = (value, formatString) => {
|
|
159
|
+
return (0, _format.format)(value, formatString, {
|
|
160
|
+
locale: this.locale
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
formatNumber = numberToFormat => {
|
|
164
|
+
return numberToFormat.replace(/\d/g, match => NUMBER_SYMBOL_MAP[match]).replace(/,/g, '،');
|
|
165
|
+
};
|
|
166
|
+
isEqual = (value, comparing) => {
|
|
167
|
+
if (value === null && comparing === null) {
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
if (value === null || comparing === null) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
return (0, _isEqual.isEqual)(value, comparing);
|
|
174
|
+
};
|
|
175
|
+
isSameYear = (value, comparing) => {
|
|
176
|
+
return (0, _isSameYear.isSameYear)(value, comparing);
|
|
177
|
+
};
|
|
178
|
+
isSameMonth = (value, comparing) => {
|
|
179
|
+
return (0, _isSameMonth.isSameMonth)(value, comparing);
|
|
180
|
+
};
|
|
181
|
+
isSameDay = (value, comparing) => {
|
|
182
|
+
return (0, _isSameDay.isSameDay)(value, comparing);
|
|
183
|
+
};
|
|
184
|
+
isSameHour = (value, comparing) => {
|
|
185
|
+
return (0, _isSameHour.isSameHour)(value, comparing);
|
|
186
|
+
};
|
|
187
|
+
isAfter = (value, comparing) => {
|
|
188
|
+
return (0, _isAfter.isAfter)(value, comparing);
|
|
189
|
+
};
|
|
190
|
+
isAfterYear = (value, comparing) => {
|
|
191
|
+
return (0, _isAfter.isAfter)(value, this.endOfYear(comparing));
|
|
192
|
+
};
|
|
193
|
+
isAfterDay = (value, comparing) => {
|
|
194
|
+
return (0, _isAfter.isAfter)(value, this.endOfDay(comparing));
|
|
195
|
+
};
|
|
196
|
+
isBefore = (value, comparing) => {
|
|
197
|
+
return (0, _isBefore.isBefore)(value, comparing);
|
|
198
|
+
};
|
|
199
|
+
isBeforeYear = (value, comparing) => {
|
|
200
|
+
return (0, _isBefore.isBefore)(value, this.startOfYear(comparing));
|
|
201
|
+
};
|
|
202
|
+
isBeforeDay = (value, comparing) => {
|
|
203
|
+
return (0, _isBefore.isBefore)(value, this.startOfDay(comparing));
|
|
204
|
+
};
|
|
205
|
+
isWithinRange = (value, [start, end]) => {
|
|
206
|
+
return (0, _isWithinInterval.isWithinInterval)(value, {
|
|
207
|
+
start,
|
|
208
|
+
end
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
startOfYear = value => {
|
|
212
|
+
return (0, _startOfYear.startOfYear)(value);
|
|
213
|
+
};
|
|
214
|
+
startOfMonth = value => {
|
|
215
|
+
return (0, _startOfMonth.startOfMonth)(value);
|
|
216
|
+
};
|
|
217
|
+
startOfWeek = value => {
|
|
218
|
+
return (0, _startOfWeek.startOfWeek)(value, {
|
|
219
|
+
locale: this.locale
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
startOfDay = value => {
|
|
223
|
+
return (0, _startOfDay.startOfDay)(value);
|
|
224
|
+
};
|
|
225
|
+
endOfYear = value => {
|
|
226
|
+
return (0, _endOfYear.endOfYear)(value);
|
|
227
|
+
};
|
|
228
|
+
endOfMonth = value => {
|
|
229
|
+
return (0, _endOfMonth.endOfMonth)(value);
|
|
230
|
+
};
|
|
231
|
+
endOfWeek = value => {
|
|
232
|
+
return (0, _endOfWeek.endOfWeek)(value, {
|
|
233
|
+
locale: this.locale
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
endOfDay = value => {
|
|
237
|
+
return (0, _endOfDay.endOfDay)(value);
|
|
238
|
+
};
|
|
239
|
+
addYears = (value, amount) => {
|
|
240
|
+
return (0, _addYears.addYears)(value, amount);
|
|
241
|
+
};
|
|
242
|
+
addMonths = (value, amount) => {
|
|
243
|
+
return (0, _addMonths.addMonths)(value, amount);
|
|
244
|
+
};
|
|
245
|
+
addWeeks = (value, amount) => {
|
|
246
|
+
return (0, _addWeeks.addWeeks)(value, amount);
|
|
247
|
+
};
|
|
248
|
+
addDays = (value, amount) => {
|
|
249
|
+
return (0, _addDays.addDays)(value, amount);
|
|
250
|
+
};
|
|
251
|
+
addHours = (value, amount) => {
|
|
252
|
+
return (0, _addHours.addHours)(value, amount);
|
|
253
|
+
};
|
|
254
|
+
addMinutes = (value, amount) => {
|
|
255
|
+
return (0, _addMinutes.addMinutes)(value, amount);
|
|
256
|
+
};
|
|
257
|
+
addSeconds = (value, amount) => {
|
|
258
|
+
return (0, _addSeconds.addSeconds)(value, amount);
|
|
259
|
+
};
|
|
260
|
+
getYear = value => {
|
|
261
|
+
return (0, _getYear.getYear)(value);
|
|
262
|
+
};
|
|
263
|
+
getMonth = value => {
|
|
264
|
+
return (0, _getMonth.getMonth)(value);
|
|
265
|
+
};
|
|
266
|
+
getDate = value => {
|
|
267
|
+
return (0, _getDate.getDate)(value);
|
|
268
|
+
};
|
|
269
|
+
getHours = value => {
|
|
270
|
+
return (0, _getHours.getHours)(value);
|
|
271
|
+
};
|
|
272
|
+
getMinutes = value => {
|
|
273
|
+
return (0, _getMinutes.getMinutes)(value);
|
|
274
|
+
};
|
|
275
|
+
getSeconds = value => {
|
|
276
|
+
return (0, _getSeconds.getSeconds)(value);
|
|
277
|
+
};
|
|
278
|
+
getMilliseconds = value => {
|
|
279
|
+
return (0, _getMilliseconds.getMilliseconds)(value);
|
|
280
|
+
};
|
|
281
|
+
setYear = (value, year) => {
|
|
282
|
+
return (0, _setYear.setYear)(value, year);
|
|
283
|
+
};
|
|
284
|
+
setMonth = (value, month) => {
|
|
285
|
+
return (0, _setMonth.setMonth)(value, month);
|
|
286
|
+
};
|
|
287
|
+
setDate = (value, date) => {
|
|
288
|
+
return (0, _setDate.setDate)(value, date);
|
|
289
|
+
};
|
|
290
|
+
setHours = (value, hours) => {
|
|
291
|
+
return (0, _setHours.setHours)(value, hours);
|
|
292
|
+
};
|
|
293
|
+
setMinutes = (value, minutes) => {
|
|
294
|
+
return (0, _setMinutes.setMinutes)(value, minutes);
|
|
295
|
+
};
|
|
296
|
+
setSeconds = (value, seconds) => {
|
|
297
|
+
return (0, _setSeconds.setSeconds)(value, seconds);
|
|
298
|
+
};
|
|
299
|
+
setMilliseconds = (value, milliseconds) => {
|
|
300
|
+
return (0, _setMilliseconds.setMilliseconds)(value, milliseconds);
|
|
301
|
+
};
|
|
302
|
+
getDaysInMonth = value => {
|
|
303
|
+
return (0, _getDaysInMonth.getDaysInMonth)(value);
|
|
304
|
+
};
|
|
305
|
+
getWeekArray = value => {
|
|
306
|
+
const start = this.startOfWeek(this.startOfMonth(value));
|
|
307
|
+
const end = this.endOfWeek(this.endOfMonth(value));
|
|
308
|
+
let count = 0;
|
|
309
|
+
let current = start;
|
|
310
|
+
const nestedWeeks = [];
|
|
311
|
+
while (this.isBefore(current, end)) {
|
|
312
|
+
const weekNumber = Math.floor(count / 7);
|
|
313
|
+
nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
|
|
314
|
+
nestedWeeks[weekNumber].push(current);
|
|
315
|
+
current = this.addDays(current, 1);
|
|
316
|
+
count += 1;
|
|
317
|
+
}
|
|
318
|
+
return nestedWeeks;
|
|
319
|
+
};
|
|
320
|
+
getWeekNumber = date => {
|
|
321
|
+
return (0, _getWeek.getWeek)(date, {
|
|
322
|
+
locale: this.locale
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
getYearRange = ([start, end]) => {
|
|
326
|
+
const startDate = this.startOfYear(start);
|
|
327
|
+
const endDate = this.endOfYear(end);
|
|
328
|
+
const years = [];
|
|
329
|
+
let current = startDate;
|
|
330
|
+
while (this.isBefore(current, endDate)) {
|
|
331
|
+
years.push(current);
|
|
332
|
+
current = this.addYears(current, 1);
|
|
333
|
+
}
|
|
334
|
+
return years;
|
|
335
|
+
};
|
|
335
336
|
}
|
|
336
337
|
exports.AdapterDateFnsJalali = AdapterDateFnsJalali;
|