@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
@@ -92,197 +92,197 @@ export class AdapterDateFns extends AdapterDateFnsBase {
92
92
  formats,
93
93
  longFormatters
94
94
  });
95
- this.parse = (value, format) => {
96
- if (value === '') {
97
- return null;
98
- }
99
- return dateFnsParse(value, format, new Date(), {
100
- locale: this.locale
101
- });
102
- };
103
- this.isValid = value => {
104
- if (value == null) {
105
- return false;
106
- }
107
- return isValid(value);
108
- };
109
- this.format = (value, formatKey) => {
110
- return this.formatByString(value, this.formats[formatKey]);
111
- };
112
- this.formatByString = (value, formatString) => {
113
- return dateFnsFormat(value, formatString, {
114
- locale: this.locale
115
- });
116
- };
117
- this.isEqual = (value, comparing) => {
118
- if (value === null && comparing === null) {
119
- return true;
120
- }
121
- if (value === null || comparing === null) {
122
- return false;
123
- }
124
- return isEqual(value, comparing);
125
- };
126
- this.isSameYear = (value, comparing) => {
127
- return isSameYear(value, comparing);
128
- };
129
- this.isSameMonth = (value, comparing) => {
130
- return isSameMonth(value, comparing);
131
- };
132
- this.isSameDay = (value, comparing) => {
133
- return isSameDay(value, comparing);
134
- };
135
- this.isSameHour = (value, comparing) => {
136
- return isSameHour(value, comparing);
137
- };
138
- this.isAfter = (value, comparing) => {
139
- return isAfter(value, comparing);
140
- };
141
- this.isAfterYear = (value, comparing) => {
142
- return isAfter(value, endOfYear(comparing));
143
- };
144
- this.isAfterDay = (value, comparing) => {
145
- return isAfter(value, endOfDay(comparing));
146
- };
147
- this.isBefore = (value, comparing) => {
148
- return isBefore(value, comparing);
149
- };
150
- this.isBeforeYear = (value, comparing) => {
151
- return isBefore(value, this.startOfYear(comparing));
152
- };
153
- this.isBeforeDay = (value, comparing) => {
154
- return isBefore(value, this.startOfDay(comparing));
155
- };
156
- this.isWithinRange = (value, [start, end]) => {
157
- return isWithinInterval(value, {
158
- start,
159
- end
160
- });
161
- };
162
- this.startOfYear = value => {
163
- return startOfYear(value);
164
- };
165
- this.startOfMonth = value => {
166
- return startOfMonth(value);
167
- };
168
- this.startOfWeek = value => {
169
- return startOfWeek(value, {
170
- locale: this.locale
171
- });
172
- };
173
- this.startOfDay = value => {
174
- return startOfDay(value);
175
- };
176
- this.endOfYear = value => {
177
- return endOfYear(value);
178
- };
179
- this.endOfMonth = value => {
180
- return endOfMonth(value);
181
- };
182
- this.endOfWeek = value => {
183
- return endOfWeek(value, {
184
- locale: this.locale
185
- });
186
- };
187
- this.endOfDay = value => {
188
- return endOfDay(value);
189
- };
190
- this.addYears = (value, amount) => {
191
- return addYears(value, amount);
192
- };
193
- this.addMonths = (value, amount) => {
194
- return addMonths(value, amount);
195
- };
196
- this.addWeeks = (value, amount) => {
197
- return addWeeks(value, amount);
198
- };
199
- this.addDays = (value, amount) => {
200
- return addDays(value, amount);
201
- };
202
- this.addHours = (value, amount) => {
203
- return addHours(value, amount);
204
- };
205
- this.addMinutes = (value, amount) => {
206
- return addMinutes(value, amount);
207
- };
208
- this.addSeconds = (value, amount) => {
209
- return addSeconds(value, amount);
210
- };
211
- this.getYear = value => {
212
- return getYear(value);
213
- };
214
- this.getMonth = value => {
215
- return getMonth(value);
216
- };
217
- this.getDate = value => {
218
- return getDate(value);
219
- };
220
- this.getHours = value => {
221
- return getHours(value);
222
- };
223
- this.getMinutes = value => {
224
- return getMinutes(value);
225
- };
226
- this.getSeconds = value => {
227
- return getSeconds(value);
228
- };
229
- this.getMilliseconds = value => {
230
- return getMilliseconds(value);
231
- };
232
- this.setYear = (value, year) => {
233
- return setYear(value, year);
234
- };
235
- this.setMonth = (value, month) => {
236
- return setMonth(value, month);
237
- };
238
- this.setDate = (value, date) => {
239
- return setDate(value, date);
240
- };
241
- this.setHours = (value, hours) => {
242
- return setHours(value, hours);
243
- };
244
- this.setMinutes = (value, minutes) => {
245
- return setMinutes(value, minutes);
246
- };
247
- this.setSeconds = (value, seconds) => {
248
- return setSeconds(value, seconds);
249
- };
250
- this.setMilliseconds = (value, milliseconds) => {
251
- return setMilliseconds(value, milliseconds);
252
- };
253
- this.getDaysInMonth = value => {
254
- return getDaysInMonth(value);
255
- };
256
- this.getWeekArray = value => {
257
- const start = this.startOfWeek(this.startOfMonth(value));
258
- const end = this.endOfWeek(this.endOfMonth(value));
259
- let count = 0;
260
- let current = start;
261
- const nestedWeeks = [];
262
- while (this.isBefore(current, end)) {
263
- const weekNumber = Math.floor(count / 7);
264
- nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
265
- nestedWeeks[weekNumber].push(current);
266
- current = this.addDays(current, 1);
267
- count += 1;
268
- }
269
- return nestedWeeks;
270
- };
271
- this.getWeekNumber = value => {
272
- return getWeek(value, {
273
- locale: this.locale
274
- });
275
- };
276
- this.getYearRange = ([start, end]) => {
277
- const startDate = this.startOfYear(start);
278
- const endDate = this.endOfYear(end);
279
- const years = [];
280
- let current = startDate;
281
- while (this.isBefore(current, endDate)) {
282
- years.push(current);
283
- current = this.addYears(current, 1);
284
- }
285
- return years;
286
- };
287
95
  }
96
+ parse = (value, format) => {
97
+ if (value === '') {
98
+ return null;
99
+ }
100
+ return dateFnsParse(value, format, new Date(), {
101
+ locale: this.locale
102
+ });
103
+ };
104
+ isValid = value => {
105
+ if (value == null) {
106
+ return false;
107
+ }
108
+ return isValid(value);
109
+ };
110
+ format = (value, formatKey) => {
111
+ return this.formatByString(value, this.formats[formatKey]);
112
+ };
113
+ formatByString = (value, formatString) => {
114
+ return dateFnsFormat(value, formatString, {
115
+ locale: this.locale
116
+ });
117
+ };
118
+ isEqual = (value, comparing) => {
119
+ if (value === null && comparing === null) {
120
+ return true;
121
+ }
122
+ if (value === null || comparing === null) {
123
+ return false;
124
+ }
125
+ return isEqual(value, comparing);
126
+ };
127
+ isSameYear = (value, comparing) => {
128
+ return isSameYear(value, comparing);
129
+ };
130
+ isSameMonth = (value, comparing) => {
131
+ return isSameMonth(value, comparing);
132
+ };
133
+ isSameDay = (value, comparing) => {
134
+ return isSameDay(value, comparing);
135
+ };
136
+ isSameHour = (value, comparing) => {
137
+ return isSameHour(value, comparing);
138
+ };
139
+ isAfter = (value, comparing) => {
140
+ return isAfter(value, comparing);
141
+ };
142
+ isAfterYear = (value, comparing) => {
143
+ return isAfter(value, endOfYear(comparing));
144
+ };
145
+ isAfterDay = (value, comparing) => {
146
+ return isAfter(value, endOfDay(comparing));
147
+ };
148
+ isBefore = (value, comparing) => {
149
+ return isBefore(value, comparing);
150
+ };
151
+ isBeforeYear = (value, comparing) => {
152
+ return isBefore(value, this.startOfYear(comparing));
153
+ };
154
+ isBeforeDay = (value, comparing) => {
155
+ return isBefore(value, this.startOfDay(comparing));
156
+ };
157
+ isWithinRange = (value, [start, end]) => {
158
+ return isWithinInterval(value, {
159
+ start,
160
+ end
161
+ });
162
+ };
163
+ startOfYear = value => {
164
+ return startOfYear(value);
165
+ };
166
+ startOfMonth = value => {
167
+ return startOfMonth(value);
168
+ };
169
+ startOfWeek = value => {
170
+ return startOfWeek(value, {
171
+ locale: this.locale
172
+ });
173
+ };
174
+ startOfDay = value => {
175
+ return startOfDay(value);
176
+ };
177
+ endOfYear = value => {
178
+ return endOfYear(value);
179
+ };
180
+ endOfMonth = value => {
181
+ return endOfMonth(value);
182
+ };
183
+ endOfWeek = value => {
184
+ return endOfWeek(value, {
185
+ locale: this.locale
186
+ });
187
+ };
188
+ endOfDay = value => {
189
+ return endOfDay(value);
190
+ };
191
+ addYears = (value, amount) => {
192
+ return addYears(value, amount);
193
+ };
194
+ addMonths = (value, amount) => {
195
+ return addMonths(value, amount);
196
+ };
197
+ addWeeks = (value, amount) => {
198
+ return addWeeks(value, amount);
199
+ };
200
+ addDays = (value, amount) => {
201
+ return addDays(value, amount);
202
+ };
203
+ addHours = (value, amount) => {
204
+ return addHours(value, amount);
205
+ };
206
+ addMinutes = (value, amount) => {
207
+ return addMinutes(value, amount);
208
+ };
209
+ addSeconds = (value, amount) => {
210
+ return addSeconds(value, amount);
211
+ };
212
+ getYear = value => {
213
+ return getYear(value);
214
+ };
215
+ getMonth = value => {
216
+ return getMonth(value);
217
+ };
218
+ getDate = value => {
219
+ return getDate(value);
220
+ };
221
+ getHours = value => {
222
+ return getHours(value);
223
+ };
224
+ getMinutes = value => {
225
+ return getMinutes(value);
226
+ };
227
+ getSeconds = value => {
228
+ return getSeconds(value);
229
+ };
230
+ getMilliseconds = value => {
231
+ return getMilliseconds(value);
232
+ };
233
+ setYear = (value, year) => {
234
+ return setYear(value, year);
235
+ };
236
+ setMonth = (value, month) => {
237
+ return setMonth(value, month);
238
+ };
239
+ setDate = (value, date) => {
240
+ return setDate(value, date);
241
+ };
242
+ setHours = (value, hours) => {
243
+ return setHours(value, hours);
244
+ };
245
+ setMinutes = (value, minutes) => {
246
+ return setMinutes(value, minutes);
247
+ };
248
+ setSeconds = (value, seconds) => {
249
+ return setSeconds(value, seconds);
250
+ };
251
+ setMilliseconds = (value, milliseconds) => {
252
+ return setMilliseconds(value, milliseconds);
253
+ };
254
+ getDaysInMonth = value => {
255
+ return getDaysInMonth(value);
256
+ };
257
+ getWeekArray = value => {
258
+ const start = this.startOfWeek(this.startOfMonth(value));
259
+ const end = this.endOfWeek(this.endOfMonth(value));
260
+ let count = 0;
261
+ let current = start;
262
+ const nestedWeeks = [];
263
+ while (this.isBefore(current, end)) {
264
+ const weekNumber = Math.floor(count / 7);
265
+ nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
266
+ nestedWeeks[weekNumber].push(current);
267
+ current = this.addDays(current, 1);
268
+ count += 1;
269
+ }
270
+ return nestedWeeks;
271
+ };
272
+ getWeekNumber = value => {
273
+ return getWeek(value, {
274
+ locale: this.locale
275
+ });
276
+ };
277
+ getYearRange = ([start, end]) => {
278
+ const startDate = this.startOfYear(start);
279
+ const endDate = this.endOfYear(end);
280
+ const years = [];
281
+ let current = startDate;
282
+ while (this.isBefore(current, endDate)) {
283
+ years.push(current);
284
+ current = this.addYears(current, 1);
285
+ }
286
+ return years;
287
+ };
288
288
  }