@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.
@@ -139,201 +139,201 @@ class AdapterDateFnsJalali extends _AdapterDateFnsBase.AdapterDateFnsBase {
139
139
  longFormatters: _index42.default,
140
140
  lib: 'date-fns-jalali'
141
141
  });
142
- this.parse = (value, format) => {
143
- if (value === '') {
144
- return null;
145
- }
146
- return (0, _index27.default)(value, format, new Date(), {
147
- locale: this.locale
148
- });
149
- };
150
- this.isValid = value => {
151
- if (value == null) {
152
- return false;
153
- }
154
- return (0, _index26.default)(value);
155
- };
156
- this.format = (value, formatKey) => {
157
- return this.formatByString(value, this.formats[formatKey]);
158
- };
159
- this.formatByString = (value, formatString) => {
160
- return (0, _index1.default)(value, formatString, {
161
- locale: this.locale
162
- });
163
- };
164
- this.formatNumber = numberToFormat => {
165
- return numberToFormat.replace(/\d/g, match => NUMBER_SYMBOL_MAP[match]).replace(/,/g, '،');
166
- };
167
- this.isEqual = (value, comparing) => {
168
- if (value === null && comparing === null) {
169
- return true;
170
- }
171
- if (value === null || comparing === null) {
172
- return false;
173
- }
174
- return (0, _index21.default)(value, comparing);
175
- };
176
- this.isSameYear = (value, comparing) => {
177
- return (0, _index23.default)(value, comparing);
178
- };
179
- this.isSameMonth = (value, comparing) => {
180
- return (0, _index24.default)(value, comparing);
181
- };
182
- this.isSameDay = (value, comparing) => {
183
- return (0, _index22.default)(value, comparing);
184
- };
185
- this.isSameHour = (value, comparing) => {
186
- return (0, _index25.default)(value, comparing);
187
- };
188
- this.isAfter = (value, comparing) => {
189
- return (0, _index19.default)(value, comparing);
190
- };
191
- this.isAfterYear = (value, comparing) => {
192
- return (0, _index19.default)(value, this.endOfYear(comparing));
193
- };
194
- this.isAfterDay = (value, comparing) => {
195
- return (0, _index19.default)(value, this.endOfDay(comparing));
196
- };
197
- this.isBefore = (value, comparing) => {
198
- return (0, _index20.default)(value, comparing);
199
- };
200
- this.isBeforeYear = (value, comparing) => {
201
- return (0, _index20.default)(value, this.startOfYear(comparing));
202
- };
203
- this.isBeforeDay = (value, comparing) => {
204
- return (0, _index20.default)(value, this.startOfDay(comparing));
205
- };
206
- this.isWithinRange = (value, [start, end]) => {
207
- return (0, _index40.default)(value, {
208
- start,
209
- end
210
- });
211
- };
212
- this.startOfYear = value => {
213
- return (0, _index39.default)(value);
214
- };
215
- this.startOfMonth = value => {
216
- return (0, _index36.default)(value);
217
- };
218
- this.startOfWeek = value => {
219
- return (0, _index38.default)(value, {
220
- locale: this.locale
221
- });
222
- };
223
- this.startOfDay = value => {
224
- return (0, _index35.default)(value);
225
- };
226
- this.endOfYear = value => {
227
- return (0, _index0.default)(value);
228
- };
229
- this.endOfMonth = value => {
230
- return (0, _index37.default)(value);
231
- };
232
- this.endOfWeek = value => {
233
- return (0, _index9.default)(value, {
234
- locale: this.locale
235
- });
236
- };
237
- this.endOfDay = value => {
238
- return (0, _index8.default)(value);
239
- };
240
- this.addYears = (value, amount) => {
241
- return (0, _index7.default)(value, amount);
242
- };
243
- this.addMonths = (value, amount) => {
244
- return (0, _index6.default)(value, amount);
245
- };
246
- this.addWeeks = (value, amount) => {
247
- return (0, _index5.default)(value, amount);
248
- };
249
- this.addDays = (value, amount) => {
250
- return (0, _index4.default)(value, amount);
251
- };
252
- this.addHours = (value, amount) => {
253
- return (0, _index3.default)(value, amount);
254
- };
255
- this.addMinutes = (value, amount) => {
256
- return (0, _index2.default)(value, amount);
257
- };
258
- this.addSeconds = (value, amount) => {
259
- return (0, _index.default)(value, amount);
260
- };
261
- this.getYear = value => {
262
- return (0, _index14.default)(value);
263
- };
264
- this.getMonth = value => {
265
- return (0, _index15.default)(value);
266
- };
267
- this.getDate = value => {
268
- return (0, _index16.default)(value);
269
- };
270
- this.getHours = value => {
271
- return (0, _index10.default)(value);
272
- };
273
- this.getMinutes = value => {
274
- return (0, _index18.default)(value);
275
- };
276
- this.getSeconds = value => {
277
- return (0, _index11.default)(value);
278
- };
279
- this.getMilliseconds = value => {
280
- return (0, _index12.default)(value);
281
- };
282
- this.setYear = (value, year) => {
283
- return (0, _index34.default)(value, year);
284
- };
285
- this.setMonth = (value, month) => {
286
- return (0, _index31.default)(value, month);
287
- };
288
- this.setDate = (value, date) => {
289
- return (0, _index28.default)(value, date);
290
- };
291
- this.setHours = (value, hours) => {
292
- return (0, _index29.default)(value, hours);
293
- };
294
- this.setMinutes = (value, minutes) => {
295
- return (0, _index30.default)(value, minutes);
296
- };
297
- this.setSeconds = (value, seconds) => {
298
- return (0, _index32.default)(value, seconds);
299
- };
300
- this.setMilliseconds = (value, milliseconds) => {
301
- return (0, _index33.default)(value, milliseconds);
302
- };
303
- this.getDaysInMonth = value => {
304
- return (0, _index17.default)(value);
305
- };
306
- this.getWeekArray = value => {
307
- const start = this.startOfWeek(this.startOfMonth(value));
308
- const end = this.endOfWeek(this.endOfMonth(value));
309
- let count = 0;
310
- let current = start;
311
- const nestedWeeks = [];
312
- while (this.isBefore(current, end)) {
313
- const weekNumber = Math.floor(count / 7);
314
- nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
315
- nestedWeeks[weekNumber].push(current);
316
- current = this.addDays(current, 1);
317
- count += 1;
318
- }
319
- return nestedWeeks;
320
- };
321
- this.getWeekNumber = date => {
322
- return (0, _index13.default)(date, {
323
- locale: this.locale
324
- });
325
- };
326
- this.getYearRange = ([start, end]) => {
327
- const startDate = this.startOfYear(start);
328
- const endDate = this.endOfYear(end);
329
- const years = [];
330
- let current = startDate;
331
- while (this.isBefore(current, endDate)) {
332
- years.push(current);
333
- current = this.addYears(current, 1);
334
- }
335
- return years;
336
- };
337
142
  }
143
+ parse = (value, format) => {
144
+ if (value === '') {
145
+ return null;
146
+ }
147
+ return (0, _index27.default)(value, format, new Date(), {
148
+ locale: this.locale
149
+ });
150
+ };
151
+ isValid = value => {
152
+ if (value == null) {
153
+ return false;
154
+ }
155
+ return (0, _index26.default)(value);
156
+ };
157
+ format = (value, formatKey) => {
158
+ return this.formatByString(value, this.formats[formatKey]);
159
+ };
160
+ formatByString = (value, formatString) => {
161
+ return (0, _index1.default)(value, formatString, {
162
+ locale: this.locale
163
+ });
164
+ };
165
+ formatNumber = numberToFormat => {
166
+ return numberToFormat.replace(/\d/g, match => NUMBER_SYMBOL_MAP[match]).replace(/,/g, '،');
167
+ };
168
+ isEqual = (value, comparing) => {
169
+ if (value === null && comparing === null) {
170
+ return true;
171
+ }
172
+ if (value === null || comparing === null) {
173
+ return false;
174
+ }
175
+ return (0, _index21.default)(value, comparing);
176
+ };
177
+ isSameYear = (value, comparing) => {
178
+ return (0, _index23.default)(value, comparing);
179
+ };
180
+ isSameMonth = (value, comparing) => {
181
+ return (0, _index24.default)(value, comparing);
182
+ };
183
+ isSameDay = (value, comparing) => {
184
+ return (0, _index22.default)(value, comparing);
185
+ };
186
+ isSameHour = (value, comparing) => {
187
+ return (0, _index25.default)(value, comparing);
188
+ };
189
+ isAfter = (value, comparing) => {
190
+ return (0, _index19.default)(value, comparing);
191
+ };
192
+ isAfterYear = (value, comparing) => {
193
+ return (0, _index19.default)(value, this.endOfYear(comparing));
194
+ };
195
+ isAfterDay = (value, comparing) => {
196
+ return (0, _index19.default)(value, this.endOfDay(comparing));
197
+ };
198
+ isBefore = (value, comparing) => {
199
+ return (0, _index20.default)(value, comparing);
200
+ };
201
+ isBeforeYear = (value, comparing) => {
202
+ return (0, _index20.default)(value, this.startOfYear(comparing));
203
+ };
204
+ isBeforeDay = (value, comparing) => {
205
+ return (0, _index20.default)(value, this.startOfDay(comparing));
206
+ };
207
+ isWithinRange = (value, [start, end]) => {
208
+ return (0, _index40.default)(value, {
209
+ start,
210
+ end
211
+ });
212
+ };
213
+ startOfYear = value => {
214
+ return (0, _index39.default)(value);
215
+ };
216
+ startOfMonth = value => {
217
+ return (0, _index36.default)(value);
218
+ };
219
+ startOfWeek = value => {
220
+ return (0, _index38.default)(value, {
221
+ locale: this.locale
222
+ });
223
+ };
224
+ startOfDay = value => {
225
+ return (0, _index35.default)(value);
226
+ };
227
+ endOfYear = value => {
228
+ return (0, _index0.default)(value);
229
+ };
230
+ endOfMonth = value => {
231
+ return (0, _index37.default)(value);
232
+ };
233
+ endOfWeek = value => {
234
+ return (0, _index9.default)(value, {
235
+ locale: this.locale
236
+ });
237
+ };
238
+ endOfDay = value => {
239
+ return (0, _index8.default)(value);
240
+ };
241
+ addYears = (value, amount) => {
242
+ return (0, _index7.default)(value, amount);
243
+ };
244
+ addMonths = (value, amount) => {
245
+ return (0, _index6.default)(value, amount);
246
+ };
247
+ addWeeks = (value, amount) => {
248
+ return (0, _index5.default)(value, amount);
249
+ };
250
+ addDays = (value, amount) => {
251
+ return (0, _index4.default)(value, amount);
252
+ };
253
+ addHours = (value, amount) => {
254
+ return (0, _index3.default)(value, amount);
255
+ };
256
+ addMinutes = (value, amount) => {
257
+ return (0, _index2.default)(value, amount);
258
+ };
259
+ addSeconds = (value, amount) => {
260
+ return (0, _index.default)(value, amount);
261
+ };
262
+ getYear = value => {
263
+ return (0, _index14.default)(value);
264
+ };
265
+ getMonth = value => {
266
+ return (0, _index15.default)(value);
267
+ };
268
+ getDate = value => {
269
+ return (0, _index16.default)(value);
270
+ };
271
+ getHours = value => {
272
+ return (0, _index10.default)(value);
273
+ };
274
+ getMinutes = value => {
275
+ return (0, _index18.default)(value);
276
+ };
277
+ getSeconds = value => {
278
+ return (0, _index11.default)(value);
279
+ };
280
+ getMilliseconds = value => {
281
+ return (0, _index12.default)(value);
282
+ };
283
+ setYear = (value, year) => {
284
+ return (0, _index34.default)(value, year);
285
+ };
286
+ setMonth = (value, month) => {
287
+ return (0, _index31.default)(value, month);
288
+ };
289
+ setDate = (value, date) => {
290
+ return (0, _index28.default)(value, date);
291
+ };
292
+ setHours = (value, hours) => {
293
+ return (0, _index29.default)(value, hours);
294
+ };
295
+ setMinutes = (value, minutes) => {
296
+ return (0, _index30.default)(value, minutes);
297
+ };
298
+ setSeconds = (value, seconds) => {
299
+ return (0, _index32.default)(value, seconds);
300
+ };
301
+ setMilliseconds = (value, milliseconds) => {
302
+ return (0, _index33.default)(value, milliseconds);
303
+ };
304
+ getDaysInMonth = value => {
305
+ return (0, _index17.default)(value);
306
+ };
307
+ getWeekArray = value => {
308
+ const start = this.startOfWeek(this.startOfMonth(value));
309
+ const end = this.endOfWeek(this.endOfMonth(value));
310
+ let count = 0;
311
+ let current = start;
312
+ const nestedWeeks = [];
313
+ while (this.isBefore(current, end)) {
314
+ const weekNumber = Math.floor(count / 7);
315
+ nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
316
+ nestedWeeks[weekNumber].push(current);
317
+ current = this.addDays(current, 1);
318
+ count += 1;
319
+ }
320
+ return nestedWeeks;
321
+ };
322
+ getWeekNumber = date => {
323
+ return (0, _index13.default)(date, {
324
+ locale: this.locale
325
+ });
326
+ };
327
+ getYearRange = ([start, end]) => {
328
+ const startDate = this.startOfYear(start);
329
+ const endDate = this.endOfYear(end);
330
+ const years = [];
331
+ let current = startDate;
332
+ while (this.isBefore(current, endDate)) {
333
+ years.push(current);
334
+ current = this.addYears(current, 1);
335
+ }
336
+ return years;
337
+ };
338
338
  }
339
339
  exports.AdapterDateFnsJalali = AdapterDateFnsJalali;