@mui/x-date-pickers 8.9.2 → 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.
Files changed (30) hide show
  1. package/AdapterDateFns/AdapterDateFns.js +194 -193
  2. package/AdapterDateFnsBase/AdapterDateFnsBase.js +57 -60
  3. package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +197 -196
  4. package/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js +195 -195
  5. package/AdapterDateFnsV2/AdapterDateFnsV2.js +192 -192
  6. package/AdapterDayjs/AdapterDayjs.js +378 -378
  7. package/AdapterLuxon/AdapterLuxon.js +324 -324
  8. package/AdapterMoment/AdapterMoment.js +297 -300
  9. package/AdapterMomentHijri/AdapterMomentHijri.js +78 -77
  10. package/AdapterMomentJalaali/AdapterMomentJalaali.js +78 -79
  11. package/CHANGELOG.md +303 -6
  12. package/PickersLayout/PickersLayout.js +12 -9
  13. package/PickersLayout/PickersLayout.types.d.ts +5 -0
  14. package/PickersLayout/usePickerLayout.js +6 -2
  15. package/esm/AdapterDateFns/AdapterDateFns.js +194 -193
  16. package/esm/AdapterDateFnsBase/AdapterDateFnsBase.js +57 -60
  17. package/esm/AdapterDateFnsJalali/AdapterDateFnsJalali.js +197 -196
  18. package/esm/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js +195 -195
  19. package/esm/AdapterDateFnsV2/AdapterDateFnsV2.js +192 -192
  20. package/esm/AdapterDayjs/AdapterDayjs.js +378 -378
  21. package/esm/AdapterLuxon/AdapterLuxon.js +324 -324
  22. package/esm/AdapterMoment/AdapterMoment.js +297 -300
  23. package/esm/AdapterMomentHijri/AdapterMomentHijri.js +78 -77
  24. package/esm/AdapterMomentJalaali/AdapterMomentJalaali.js +78 -79
  25. package/esm/PickersLayout/PickersLayout.js +12 -9
  26. package/esm/PickersLayout/PickersLayout.types.d.ts +5 -0
  27. package/esm/PickersLayout/usePickerLayout.js +6 -2
  28. package/esm/index.js +1 -1
  29. package/index.js +1 -1
  30. package/package.json +7 -9
@@ -131,200 +131,200 @@ export class AdapterDateFnsJalali extends AdapterDateFnsBase {
131
131
  longFormatters,
132
132
  lib: 'date-fns-jalali'
133
133
  });
134
- this.parse = (value, format) => {
135
- if (value === '') {
136
- return null;
137
- }
138
- return dateFnsParse(value, format, new Date(), {
139
- locale: this.locale
140
- });
141
- };
142
- this.isValid = value => {
143
- if (value == null) {
144
- return false;
145
- }
146
- return isValid(value);
147
- };
148
- this.format = (value, formatKey) => {
149
- return this.formatByString(value, this.formats[formatKey]);
150
- };
151
- this.formatByString = (value, formatString) => {
152
- return dateFnsFormat(value, formatString, {
153
- locale: this.locale
154
- });
155
- };
156
- this.formatNumber = numberToFormat => {
157
- return numberToFormat.replace(/\d/g, match => NUMBER_SYMBOL_MAP[match]).replace(/,/g, '،');
158
- };
159
- this.isEqual = (value, comparing) => {
160
- if (value === null && comparing === null) {
161
- return true;
162
- }
163
- if (value === null || comparing === null) {
164
- return false;
165
- }
166
- return isEqual(value, comparing);
167
- };
168
- this.isSameYear = (value, comparing) => {
169
- return isSameYear(value, comparing);
170
- };
171
- this.isSameMonth = (value, comparing) => {
172
- return isSameMonth(value, comparing);
173
- };
174
- this.isSameDay = (value, comparing) => {
175
- return isSameDay(value, comparing);
176
- };
177
- this.isSameHour = (value, comparing) => {
178
- return isSameHour(value, comparing);
179
- };
180
- this.isAfter = (value, comparing) => {
181
- return isAfter(value, comparing);
182
- };
183
- this.isAfterYear = (value, comparing) => {
184
- return isAfter(value, this.endOfYear(comparing));
185
- };
186
- this.isAfterDay = (value, comparing) => {
187
- return isAfter(value, this.endOfDay(comparing));
188
- };
189
- this.isBefore = (value, comparing) => {
190
- return isBefore(value, comparing);
191
- };
192
- this.isBeforeYear = (value, comparing) => {
193
- return isBefore(value, this.startOfYear(comparing));
194
- };
195
- this.isBeforeDay = (value, comparing) => {
196
- return isBefore(value, this.startOfDay(comparing));
197
- };
198
- this.isWithinRange = (value, [start, end]) => {
199
- return isWithinInterval(value, {
200
- start,
201
- end
202
- });
203
- };
204
- this.startOfYear = value => {
205
- return startOfYear(value);
206
- };
207
- this.startOfMonth = value => {
208
- return startOfMonth(value);
209
- };
210
- this.startOfWeek = value => {
211
- return startOfWeek(value, {
212
- locale: this.locale
213
- });
214
- };
215
- this.startOfDay = value => {
216
- return startOfDay(value);
217
- };
218
- this.endOfYear = value => {
219
- return endOfYear(value);
220
- };
221
- this.endOfMonth = value => {
222
- return endOfMonth(value);
223
- };
224
- this.endOfWeek = value => {
225
- return endOfWeek(value, {
226
- locale: this.locale
227
- });
228
- };
229
- this.endOfDay = value => {
230
- return endOfDay(value);
231
- };
232
- this.addYears = (value, amount) => {
233
- return addYears(value, amount);
234
- };
235
- this.addMonths = (value, amount) => {
236
- return addMonths(value, amount);
237
- };
238
- this.addWeeks = (value, amount) => {
239
- return addWeeks(value, amount);
240
- };
241
- this.addDays = (value, amount) => {
242
- return addDays(value, amount);
243
- };
244
- this.addHours = (value, amount) => {
245
- return addHours(value, amount);
246
- };
247
- this.addMinutes = (value, amount) => {
248
- return addMinutes(value, amount);
249
- };
250
- this.addSeconds = (value, amount) => {
251
- return addSeconds(value, amount);
252
- };
253
- this.getYear = value => {
254
- return getYear(value);
255
- };
256
- this.getMonth = value => {
257
- return getMonth(value);
258
- };
259
- this.getDate = value => {
260
- return getDate(value);
261
- };
262
- this.getHours = value => {
263
- return getHours(value);
264
- };
265
- this.getMinutes = value => {
266
- return getMinutes(value);
267
- };
268
- this.getSeconds = value => {
269
- return getSeconds(value);
270
- };
271
- this.getMilliseconds = value => {
272
- return getMilliseconds(value);
273
- };
274
- this.setYear = (value, year) => {
275
- return setYear(value, year);
276
- };
277
- this.setMonth = (value, month) => {
278
- return setMonth(value, month);
279
- };
280
- this.setDate = (value, date) => {
281
- return setDate(value, date);
282
- };
283
- this.setHours = (value, hours) => {
284
- return setHours(value, hours);
285
- };
286
- this.setMinutes = (value, minutes) => {
287
- return setMinutes(value, minutes);
288
- };
289
- this.setSeconds = (value, seconds) => {
290
- return setSeconds(value, seconds);
291
- };
292
- this.setMilliseconds = (value, milliseconds) => {
293
- return setMilliseconds(value, milliseconds);
294
- };
295
- this.getDaysInMonth = value => {
296
- return getDaysInMonth(value);
297
- };
298
- this.getWeekArray = value => {
299
- const start = this.startOfWeek(this.startOfMonth(value));
300
- const end = this.endOfWeek(this.endOfMonth(value));
301
- let count = 0;
302
- let current = start;
303
- const nestedWeeks = [];
304
- while (this.isBefore(current, end)) {
305
- const weekNumber = Math.floor(count / 7);
306
- nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
307
- nestedWeeks[weekNumber].push(current);
308
- current = this.addDays(current, 1);
309
- count += 1;
310
- }
311
- return nestedWeeks;
312
- };
313
- this.getWeekNumber = date => {
314
- return getWeek(date, {
315
- locale: this.locale
316
- });
317
- };
318
- this.getYearRange = ([start, end]) => {
319
- const startDate = this.startOfYear(start);
320
- const endDate = this.endOfYear(end);
321
- const years = [];
322
- let current = startDate;
323
- while (this.isBefore(current, endDate)) {
324
- years.push(current);
325
- current = this.addYears(current, 1);
326
- }
327
- return years;
328
- };
329
134
  }
135
+ parse = (value, format) => {
136
+ if (value === '') {
137
+ return null;
138
+ }
139
+ return dateFnsParse(value, format, new Date(), {
140
+ locale: this.locale
141
+ });
142
+ };
143
+ isValid = value => {
144
+ if (value == null) {
145
+ return false;
146
+ }
147
+ return isValid(value);
148
+ };
149
+ format = (value, formatKey) => {
150
+ return this.formatByString(value, this.formats[formatKey]);
151
+ };
152
+ formatByString = (value, formatString) => {
153
+ return dateFnsFormat(value, formatString, {
154
+ locale: this.locale
155
+ });
156
+ };
157
+ formatNumber = numberToFormat => {
158
+ return numberToFormat.replace(/\d/g, match => NUMBER_SYMBOL_MAP[match]).replace(/,/g, '،');
159
+ };
160
+ isEqual = (value, comparing) => {
161
+ if (value === null && comparing === null) {
162
+ return true;
163
+ }
164
+ if (value === null || comparing === null) {
165
+ return false;
166
+ }
167
+ return isEqual(value, comparing);
168
+ };
169
+ isSameYear = (value, comparing) => {
170
+ return isSameYear(value, comparing);
171
+ };
172
+ isSameMonth = (value, comparing) => {
173
+ return isSameMonth(value, comparing);
174
+ };
175
+ isSameDay = (value, comparing) => {
176
+ return isSameDay(value, comparing);
177
+ };
178
+ isSameHour = (value, comparing) => {
179
+ return isSameHour(value, comparing);
180
+ };
181
+ isAfter = (value, comparing) => {
182
+ return isAfter(value, comparing);
183
+ };
184
+ isAfterYear = (value, comparing) => {
185
+ return isAfter(value, this.endOfYear(comparing));
186
+ };
187
+ isAfterDay = (value, comparing) => {
188
+ return isAfter(value, this.endOfDay(comparing));
189
+ };
190
+ isBefore = (value, comparing) => {
191
+ return isBefore(value, comparing);
192
+ };
193
+ isBeforeYear = (value, comparing) => {
194
+ return isBefore(value, this.startOfYear(comparing));
195
+ };
196
+ isBeforeDay = (value, comparing) => {
197
+ return isBefore(value, this.startOfDay(comparing));
198
+ };
199
+ isWithinRange = (value, [start, end]) => {
200
+ return isWithinInterval(value, {
201
+ start,
202
+ end
203
+ });
204
+ };
205
+ startOfYear = value => {
206
+ return startOfYear(value);
207
+ };
208
+ startOfMonth = value => {
209
+ return startOfMonth(value);
210
+ };
211
+ startOfWeek = value => {
212
+ return startOfWeek(value, {
213
+ locale: this.locale
214
+ });
215
+ };
216
+ startOfDay = value => {
217
+ return startOfDay(value);
218
+ };
219
+ endOfYear = value => {
220
+ return endOfYear(value);
221
+ };
222
+ endOfMonth = value => {
223
+ return endOfMonth(value);
224
+ };
225
+ endOfWeek = value => {
226
+ return endOfWeek(value, {
227
+ locale: this.locale
228
+ });
229
+ };
230
+ endOfDay = value => {
231
+ return endOfDay(value);
232
+ };
233
+ addYears = (value, amount) => {
234
+ return addYears(value, amount);
235
+ };
236
+ addMonths = (value, amount) => {
237
+ return addMonths(value, amount);
238
+ };
239
+ addWeeks = (value, amount) => {
240
+ return addWeeks(value, amount);
241
+ };
242
+ addDays = (value, amount) => {
243
+ return addDays(value, amount);
244
+ };
245
+ addHours = (value, amount) => {
246
+ return addHours(value, amount);
247
+ };
248
+ addMinutes = (value, amount) => {
249
+ return addMinutes(value, amount);
250
+ };
251
+ addSeconds = (value, amount) => {
252
+ return addSeconds(value, amount);
253
+ };
254
+ getYear = value => {
255
+ return getYear(value);
256
+ };
257
+ getMonth = value => {
258
+ return getMonth(value);
259
+ };
260
+ getDate = value => {
261
+ return getDate(value);
262
+ };
263
+ getHours = value => {
264
+ return getHours(value);
265
+ };
266
+ getMinutes = value => {
267
+ return getMinutes(value);
268
+ };
269
+ getSeconds = value => {
270
+ return getSeconds(value);
271
+ };
272
+ getMilliseconds = value => {
273
+ return getMilliseconds(value);
274
+ };
275
+ setYear = (value, year) => {
276
+ return setYear(value, year);
277
+ };
278
+ setMonth = (value, month) => {
279
+ return setMonth(value, month);
280
+ };
281
+ setDate = (value, date) => {
282
+ return setDate(value, date);
283
+ };
284
+ setHours = (value, hours) => {
285
+ return setHours(value, hours);
286
+ };
287
+ setMinutes = (value, minutes) => {
288
+ return setMinutes(value, minutes);
289
+ };
290
+ setSeconds = (value, seconds) => {
291
+ return setSeconds(value, seconds);
292
+ };
293
+ setMilliseconds = (value, milliseconds) => {
294
+ return setMilliseconds(value, milliseconds);
295
+ };
296
+ getDaysInMonth = value => {
297
+ return getDaysInMonth(value);
298
+ };
299
+ getWeekArray = value => {
300
+ const start = this.startOfWeek(this.startOfMonth(value));
301
+ const end = this.endOfWeek(this.endOfMonth(value));
302
+ let count = 0;
303
+ let current = start;
304
+ const nestedWeeks = [];
305
+ while (this.isBefore(current, end)) {
306
+ const weekNumber = Math.floor(count / 7);
307
+ nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
308
+ nestedWeeks[weekNumber].push(current);
309
+ current = this.addDays(current, 1);
310
+ count += 1;
311
+ }
312
+ return nestedWeeks;
313
+ };
314
+ getWeekNumber = date => {
315
+ return getWeek(date, {
316
+ locale: this.locale
317
+ });
318
+ };
319
+ getYearRange = ([start, end]) => {
320
+ const startDate = this.startOfYear(start);
321
+ const endDate = this.endOfYear(end);
322
+ const years = [];
323
+ let current = startDate;
324
+ while (this.isBefore(current, endDate)) {
325
+ years.push(current);
326
+ current = this.addYears(current, 1);
327
+ }
328
+ return years;
329
+ };
330
330
  }