@mui/x-date-pickers 6.18.7 → 6.19.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 (136) hide show
  1. package/AdapterDateFns/AdapterDateFns.d.ts +4 -24
  2. package/AdapterDateFns/AdapterDateFns.js +11 -272
  3. package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +65 -0
  4. package/AdapterDateFnsBase/AdapterDateFnsBase.js +308 -0
  5. package/AdapterDateFnsBase/index.d.ts +1 -0
  6. package/AdapterDateFnsBase/index.js +1 -0
  7. package/AdapterDateFnsBase/package.json +6 -0
  8. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +1 -0
  9. package/AdapterDateFnsV3/AdapterDateFnsV3.d.ts +88 -0
  10. package/AdapterDateFnsV3/AdapterDateFnsV3.js +358 -0
  11. package/AdapterDateFnsV3/index.d.ts +1 -0
  12. package/AdapterDateFnsV3/index.js +1 -0
  13. package/AdapterDateFnsV3/package.json +6 -0
  14. package/AdapterLuxon/AdapterLuxon.js +0 -1
  15. package/CHANGELOG.md +106 -0
  16. package/DateCalendar/useCalendarState.js +0 -1
  17. package/DatePicker/DatePickerToolbar.d.ts +2 -2
  18. package/DatePicker/DatePickerToolbar.js +2 -7
  19. package/DateTimePicker/DateTimePickerTabs.js +6 -3
  20. package/DigitalClock/DigitalClock.js +1 -0
  21. package/DigitalClock/DigitalClock.types.d.ts +5 -0
  22. package/MonthCalendar/MonthCalendar.js +0 -1
  23. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
  24. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +5 -0
  25. package/PickersLayout/pickersLayoutClasses.js +3 -2
  26. package/PickersLayout/usePickerLayout.js +2 -1
  27. package/TimeClock/Clock.js +0 -1
  28. package/TimeClock/ClockPointer.js +0 -1
  29. package/TimeClock/TimeClock.js +1 -0
  30. package/TimeClock/TimeClock.types.d.ts +5 -0
  31. package/YearCalendar/YearCalendar.js +0 -1
  32. package/hooks/useClearableField.d.ts +1 -1
  33. package/hooks/useClearableField.js +3 -3
  34. package/index.js +1 -1
  35. package/internals/hooks/useClockReferenceDate.js +0 -1
  36. package/internals/hooks/useField/useField.utils.js +0 -2
  37. package/internals/hooks/useViews.js +0 -1
  38. package/internals/models/helpers.d.ts +1 -0
  39. package/internals/models/props/tabs.d.ts +1 -0
  40. package/legacy/AdapterDateFns/AdapterDateFns.js +278 -529
  41. package/legacy/AdapterDateFnsBase/AdapterDateFnsBase.js +308 -0
  42. package/legacy/AdapterDateFnsBase/index.js +1 -0
  43. package/legacy/AdapterDateFnsV3/AdapterDateFnsV3.js +376 -0
  44. package/legacy/AdapterDateFnsV3/index.js +1 -0
  45. package/legacy/AdapterLuxon/AdapterLuxon.js +0 -1
  46. package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +5 -6
  47. package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +5 -6
  48. package/legacy/DateCalendar/PickersSlideTransition.js +8 -9
  49. package/legacy/DateCalendar/useCalendarState.js +0 -1
  50. package/legacy/DatePicker/DatePickerToolbar.js +2 -7
  51. package/legacy/DateTimePicker/DateTimePickerTabs.js +6 -3
  52. package/legacy/DigitalClock/DigitalClock.js +1 -0
  53. package/legacy/MonthCalendar/MonthCalendar.js +0 -1
  54. package/legacy/MonthCalendar/PickersMonth.js +4 -5
  55. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
  56. package/legacy/PickersDay/PickersDay.js +5 -6
  57. package/legacy/PickersLayout/PickersLayout.js +5 -6
  58. package/legacy/PickersLayout/pickersLayoutClasses.js +3 -2
  59. package/legacy/PickersLayout/usePickerLayout.js +2 -1
  60. package/legacy/TimeClock/Clock.js +0 -1
  61. package/legacy/TimeClock/ClockNumber.js +4 -5
  62. package/legacy/TimeClock/ClockPointer.js +0 -1
  63. package/legacy/TimeClock/TimeClock.js +1 -0
  64. package/legacy/TimePicker/TimePickerToolbar.js +1 -2
  65. package/legacy/YearCalendar/PickersYear.js +4 -5
  66. package/legacy/YearCalendar/YearCalendar.js +0 -1
  67. package/legacy/hooks/useClearableField.js +3 -3
  68. package/legacy/index.js +1 -1
  69. package/legacy/internals/components/PickersModalDialog.js +3 -4
  70. package/legacy/internals/hooks/useClockReferenceDate.js +0 -1
  71. package/legacy/internals/hooks/useField/useField.utils.js +0 -2
  72. package/legacy/internals/hooks/useViews.js +0 -1
  73. package/legacy/locales/index.js +1 -0
  74. package/legacy/locales/plPL.js +0 -1
  75. package/legacy/locales/svSE.js +0 -1
  76. package/legacy/locales/urPK.js +0 -1
  77. package/locales/index.d.ts +1 -0
  78. package/locales/index.js +1 -0
  79. package/locales/plPL.js +0 -1
  80. package/locales/svSE.js +0 -1
  81. package/locales/urPK.js +0 -1
  82. package/modern/AdapterDateFns/AdapterDateFns.js +11 -271
  83. package/modern/AdapterDateFnsBase/AdapterDateFnsBase.js +307 -0
  84. package/modern/AdapterDateFnsBase/index.js +1 -0
  85. package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +358 -0
  86. package/modern/AdapterDateFnsV3/index.js +1 -0
  87. package/modern/AdapterLuxon/AdapterLuxon.js +0 -1
  88. package/modern/DateCalendar/useCalendarState.js +0 -1
  89. package/modern/DatePicker/DatePickerToolbar.js +2 -7
  90. package/modern/DateTimePicker/DateTimePickerTabs.js +6 -3
  91. package/modern/DigitalClock/DigitalClock.js +1 -0
  92. package/modern/MonthCalendar/MonthCalendar.js +0 -1
  93. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
  94. package/modern/PickersLayout/pickersLayoutClasses.js +3 -2
  95. package/modern/PickersLayout/usePickerLayout.js +2 -1
  96. package/modern/TimeClock/Clock.js +0 -1
  97. package/modern/TimeClock/ClockPointer.js +0 -1
  98. package/modern/TimeClock/TimeClock.js +1 -0
  99. package/modern/YearCalendar/YearCalendar.js +0 -1
  100. package/modern/hooks/useClearableField.js +3 -3
  101. package/modern/index.js +1 -1
  102. package/modern/internals/hooks/useClockReferenceDate.js +0 -1
  103. package/modern/internals/hooks/useField/useField.utils.js +0 -2
  104. package/modern/internals/hooks/useViews.js +0 -1
  105. package/modern/locales/index.js +1 -0
  106. package/modern/locales/plPL.js +0 -1
  107. package/modern/locales/svSE.js +0 -1
  108. package/modern/locales/urPK.js +0 -1
  109. package/node/AdapterDateFns/AdapterDateFns.js +11 -271
  110. package/node/AdapterDateFnsBase/AdapterDateFnsBase.js +315 -0
  111. package/node/AdapterDateFnsBase/index.js +12 -0
  112. package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +366 -0
  113. package/node/AdapterDateFnsV3/index.js +12 -0
  114. package/node/AdapterLuxon/AdapterLuxon.js +0 -1
  115. package/node/DateCalendar/useCalendarState.js +0 -1
  116. package/node/DatePicker/DatePickerToolbar.js +0 -4
  117. package/node/DateTimePicker/DateTimePickerTabs.js +7 -4
  118. package/node/DigitalClock/DigitalClock.js +1 -0
  119. package/node/MonthCalendar/MonthCalendar.js +0 -1
  120. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
  121. package/node/PickersLayout/pickersLayoutClasses.js +5 -3
  122. package/node/PickersLayout/usePickerLayout.js +2 -1
  123. package/node/TimeClock/Clock.js +0 -1
  124. package/node/TimeClock/ClockPointer.js +0 -1
  125. package/node/TimeClock/TimeClock.js +1 -0
  126. package/node/YearCalendar/YearCalendar.js +0 -1
  127. package/node/hooks/useClearableField.js +3 -3
  128. package/node/index.js +1 -1
  129. package/node/internals/hooks/useClockReferenceDate.js +0 -1
  130. package/node/internals/hooks/useField/useField.utils.js +0 -2
  131. package/node/internals/hooks/useViews.js +0 -1
  132. package/node/locales/index.js +11 -0
  133. package/node/locales/plPL.js +0 -1
  134. package/node/locales/svSE.js +0 -1
  135. package/node/locales/urPK.js +0 -1
  136. package/package.json +2 -2
@@ -1,5 +1,7 @@
1
+ /// <reference types="date-fns" />
1
2
  import defaultLocale from 'date-fns/locale/en-US';
2
- import { AdapterFormats, AdapterOptions, AdapterUnits, DateBuilderReturnType, FieldFormatTokenMap, MuiPickersAdapter } from '../models';
3
+ import { AdapterFormats, AdapterOptions, AdapterUnits, MuiPickersAdapter } from '../models';
4
+ import { AdapterDateFnsBase } from '../AdapterDateFnsBase';
3
5
  type DateFnsLocale = typeof defaultLocale;
4
6
  /**
5
7
  * Based on `@date-io/date-fns`
@@ -26,35 +28,14 @@ type DateFnsLocale = typeof defaultLocale;
26
28
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
29
  * SOFTWARE.
28
30
  */
29
- export declare class AdapterDateFns implements MuiPickersAdapter<Date, DateFnsLocale> {
30
- isMUIAdapter: boolean;
31
- isTimezoneCompatible: boolean;
32
- lib: string;
33
- locale?: DateFnsLocale;
34
- formats: AdapterFormats;
35
- formatTokenMap: FieldFormatTokenMap;
36
- escapedCharacters: {
37
- start: string;
38
- end: string;
39
- };
31
+ export declare class AdapterDateFns extends AdapterDateFnsBase<DateFnsLocale> implements MuiPickersAdapter<Date, DateFnsLocale> {
40
32
  constructor({ locale, formats }?: AdapterOptions<DateFnsLocale, never>);
41
- date: (value?: any) => Date | null;
42
- dateWithTimezone: <T extends string | null | undefined>(value: T) => DateBuilderReturnType<T, Date>;
43
- getTimezone: () => string;
44
- setTimezone: (value: Date) => Date;
45
- toJsDate: (value: Date) => Date;
46
33
  parseISO: (isoString: string) => Date;
47
34
  toISO: (value: Date) => string;
48
35
  parse: (value: string, format: string) => Date | null;
49
- getCurrentLocaleCode: () => string;
50
- is12HourCycleInCurrentLocale: () => boolean;
51
- expandFormat: (format: string) => string;
52
- getFormatHelperText: (format: string) => string;
53
- isNull: (value: Date | null) => boolean;
54
36
  isValid: (value: any) => boolean;
55
37
  format: (value: Date, formatKey: keyof AdapterFormats) => string;
56
38
  formatByString: (value: Date, formatString: string) => string;
57
- formatNumber: (numberToFormat: string) => string;
58
39
  getDiff: (value: Date, comparing: Date | string, unit?: AdapterUnits) => number;
59
40
  isEqual: (value: any, comparing: any) => boolean;
60
41
  isSameYear: (value: Date, comparing: Date) => boolean;
@@ -106,6 +87,5 @@ export declare class AdapterDateFns implements MuiPickersAdapter<Date, DateFnsLo
106
87
  getWeekArray: (value: Date) => Date[][];
107
88
  getWeekNumber: (value: Date) => number;
108
89
  getYearRange: (start: Date, end: Date) => Date[];
109
- getMeridiemText: (ampm: 'am' | 'pm') => "AM" | "PM";
110
90
  }
111
91
  export {};
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  /* eslint-disable class-methods-use-this */
3
2
  import addDays from 'date-fns/addDays';
4
3
  import addSeconds from 'date-fns/addSeconds';
@@ -57,202 +56,7 @@ import isWithinInterval from 'date-fns/isWithinInterval';
57
56
  import defaultLocale from 'date-fns/locale/en-US';
58
57
  // @ts-ignore
59
58
  import longFormatters from 'date-fns/_lib/format/longFormatters';
60
- const formatTokenMap = {
61
- // Year
62
- y: {
63
- sectionType: 'year',
64
- contentType: 'digit',
65
- maxLength: 4
66
- },
67
- yy: 'year',
68
- yyy: {
69
- sectionType: 'year',
70
- contentType: 'digit',
71
- maxLength: 4
72
- },
73
- yyyy: 'year',
74
- // Month
75
- M: {
76
- sectionType: 'month',
77
- contentType: 'digit',
78
- maxLength: 2
79
- },
80
- MM: 'month',
81
- MMMM: {
82
- sectionType: 'month',
83
- contentType: 'letter'
84
- },
85
- MMM: {
86
- sectionType: 'month',
87
- contentType: 'letter'
88
- },
89
- L: {
90
- sectionType: 'month',
91
- contentType: 'digit',
92
- maxLength: 2
93
- },
94
- LL: 'month',
95
- LLL: {
96
- sectionType: 'month',
97
- contentType: 'letter'
98
- },
99
- LLLL: {
100
- sectionType: 'month',
101
- contentType: 'letter'
102
- },
103
- // Day of the month
104
- d: {
105
- sectionType: 'day',
106
- contentType: 'digit',
107
- maxLength: 2
108
- },
109
- dd: 'day',
110
- do: {
111
- sectionType: 'day',
112
- contentType: 'digit-with-letter'
113
- },
114
- // Day of the week
115
- E: {
116
- sectionType: 'weekDay',
117
- contentType: 'letter'
118
- },
119
- EE: {
120
- sectionType: 'weekDay',
121
- contentType: 'letter'
122
- },
123
- EEE: {
124
- sectionType: 'weekDay',
125
- contentType: 'letter'
126
- },
127
- EEEE: {
128
- sectionType: 'weekDay',
129
- contentType: 'letter'
130
- },
131
- EEEEE: {
132
- sectionType: 'weekDay',
133
- contentType: 'letter'
134
- },
135
- i: {
136
- sectionType: 'weekDay',
137
- contentType: 'digit',
138
- maxLength: 1
139
- },
140
- ii: 'weekDay',
141
- iii: {
142
- sectionType: 'weekDay',
143
- contentType: 'letter'
144
- },
145
- iiii: {
146
- sectionType: 'weekDay',
147
- contentType: 'letter'
148
- },
149
- e: {
150
- sectionType: 'weekDay',
151
- contentType: 'digit',
152
- maxLength: 1
153
- },
154
- ee: 'weekDay',
155
- eee: {
156
- sectionType: 'weekDay',
157
- contentType: 'letter'
158
- },
159
- eeee: {
160
- sectionType: 'weekDay',
161
- contentType: 'letter'
162
- },
163
- eeeee: {
164
- sectionType: 'weekDay',
165
- contentType: 'letter'
166
- },
167
- eeeeee: {
168
- sectionType: 'weekDay',
169
- contentType: 'letter'
170
- },
171
- c: {
172
- sectionType: 'weekDay',
173
- contentType: 'digit',
174
- maxLength: 1
175
- },
176
- cc: 'weekDay',
177
- ccc: {
178
- sectionType: 'weekDay',
179
- contentType: 'letter'
180
- },
181
- cccc: {
182
- sectionType: 'weekDay',
183
- contentType: 'letter'
184
- },
185
- ccccc: {
186
- sectionType: 'weekDay',
187
- contentType: 'letter'
188
- },
189
- cccccc: {
190
- sectionType: 'weekDay',
191
- contentType: 'letter'
192
- },
193
- // Meridiem
194
- a: 'meridiem',
195
- aa: 'meridiem',
196
- aaa: 'meridiem',
197
- // Hours
198
- H: {
199
- sectionType: 'hours',
200
- contentType: 'digit',
201
- maxLength: 2
202
- },
203
- HH: 'hours',
204
- h: {
205
- sectionType: 'hours',
206
- contentType: 'digit',
207
- maxLength: 2
208
- },
209
- hh: 'hours',
210
- // Minutes
211
- m: {
212
- sectionType: 'minutes',
213
- contentType: 'digit',
214
- maxLength: 2
215
- },
216
- mm: 'minutes',
217
- // Seconds
218
- s: {
219
- sectionType: 'seconds',
220
- contentType: 'digit',
221
- maxLength: 2
222
- },
223
- ss: 'seconds'
224
- };
225
- const defaultFormats = {
226
- year: 'yyyy',
227
- month: 'LLLL',
228
- monthShort: 'MMM',
229
- dayOfMonth: 'd',
230
- weekday: 'EEEE',
231
- weekdayShort: 'EEEEEE',
232
- hours24h: 'HH',
233
- hours12h: 'hh',
234
- meridiem: 'aa',
235
- minutes: 'mm',
236
- seconds: 'ss',
237
- fullDate: 'PP',
238
- fullDateWithWeekday: 'PPPP',
239
- keyboardDate: 'P',
240
- shortDate: 'MMM d',
241
- normalDate: 'd MMMM',
242
- normalDateWithWeekday: 'EEE, MMM d',
243
- monthAndYear: 'LLLL yyyy',
244
- monthAndDate: 'MMMM d',
245
- fullTime: 'p',
246
- fullTime12h: 'hh:mm aa',
247
- fullTime24h: 'HH:mm',
248
- fullDateTime: 'PP p',
249
- fullDateTime12h: 'PP hh:mm aa',
250
- fullDateTime24h: 'PP HH:mm',
251
- keyboardDateTime: 'P p',
252
- keyboardDateTime12h: 'P hh:mm aa',
253
- keyboardDateTime24h: 'P HH:mm'
254
- };
255
-
59
+ import { AdapterDateFnsBase } from '../AdapterDateFnsBase';
256
60
  /**
257
61
  * Based on `@date-io/date-fns`
258
62
  *
@@ -278,42 +82,19 @@ const defaultFormats = {
278
82
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
279
83
  * SOFTWARE.
280
84
  */
281
- export class AdapterDateFns {
85
+ export class AdapterDateFns extends AdapterDateFnsBase {
282
86
  constructor({
283
- locale: _locale,
87
+ locale,
284
88
  formats
285
89
  } = {}) {
286
- this.isMUIAdapter = true;
287
- this.isTimezoneCompatible = false;
288
- this.lib = 'date-fns';
289
- this.locale = void 0;
290
- this.formats = void 0;
291
- this.formatTokenMap = formatTokenMap;
292
- this.escapedCharacters = {
293
- start: "'",
294
- end: "'"
295
- };
296
- this.date = value => {
297
- if (typeof value === 'undefined') {
298
- return new Date();
299
- }
300
- if (value === null) {
301
- return null;
302
- }
303
- return new Date(value);
304
- };
305
- this.dateWithTimezone = value => {
306
- return this.date(value);
307
- };
308
- this.getTimezone = () => {
309
- return 'default';
310
- };
311
- this.setTimezone = value => {
312
- return value;
313
- };
314
- this.toJsDate = value => {
315
- return value;
316
- };
90
+ if (typeof addDays !== 'function') {
91
+ 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'));
92
+ }
93
+ super({
94
+ locale: locale != null ? locale : defaultLocale,
95
+ formats,
96
+ longFormatters
97
+ });
317
98
  this.parseISO = isoString => {
318
99
  return parseISO(isoString);
319
100
  };
@@ -330,40 +111,6 @@ export class AdapterDateFns {
330
111
  locale: this.locale
331
112
  });
332
113
  };
333
- this.getCurrentLocaleCode = () => {
334
- var _this$locale;
335
- return ((_this$locale = this.locale) == null ? void 0 : _this$locale.code) || 'en-US';
336
- };
337
- // Note: date-fns input types are more lenient than this adapter, so we need to expose our more
338
- // strict signature and delegate to the more lenient signature. Otherwise, we have downstream type errors upon usage.
339
- this.is12HourCycleInCurrentLocale = () => {
340
- if (this.locale) {
341
- return /a/.test(this.locale.formatLong.time());
342
- }
343
-
344
- // By default, date-fns is using en-US locale with am/pm enabled
345
- return true;
346
- };
347
- this.expandFormat = format => {
348
- const longFormatRegexp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
349
-
350
- // @see https://github.com/date-fns/date-fns/blob/master/src/format/index.js#L31
351
- return format.match(longFormatRegexp).map(token => {
352
- const firstCharacter = token[0];
353
- if (firstCharacter === 'p' || firstCharacter === 'P') {
354
- const longFormatter = longFormatters[firstCharacter];
355
- const locale = this.locale || defaultLocale;
356
- return longFormatter(token, locale.formatLong, {});
357
- }
358
- return token;
359
- }).join('');
360
- };
361
- this.getFormatHelperText = format => {
362
- return this.expandFormat(format).replace(/(aaa|aa|a)/g, '(a|p)m').toLocaleLowerCase();
363
- };
364
- this.isNull = value => {
365
- return value === null;
366
- };
367
114
  this.isValid = value => {
368
115
  return isValid(this.date(value));
369
116
  };
@@ -375,9 +122,6 @@ export class AdapterDateFns {
375
122
  locale: this.locale
376
123
  });
377
124
  };
378
- this.formatNumber = numberToFormat => {
379
- return numberToFormat;
380
- };
381
125
  this.getDiff = (value, comparing, unit) => {
382
126
  switch (unit) {
383
127
  case 'years':
@@ -602,10 +346,5 @@ export class AdapterDateFns {
602
346
  }
603
347
  return years;
604
348
  };
605
- this.getMeridiemText = ampm => {
606
- return ampm === 'am' ? 'AM' : 'PM';
607
- };
608
- this.locale = _locale;
609
- this.formats = _extends({}, defaultFormats, formats);
610
349
  }
611
350
  }
@@ -0,0 +1,65 @@
1
+ import { AdapterFormats, AdapterOptions, DateBuilderReturnType, FieldFormatTokenMap, MuiPickersAdapter } from '../models';
2
+ import { MakeRequired } from '../internals/models/helpers';
3
+ type DateFnsLocaleBase = {
4
+ formatLong?: {
5
+ date?: any;
6
+ time?: any;
7
+ dateTime?: any;
8
+ };
9
+ code?: string;
10
+ };
11
+ type DateFnsAdapterBaseOptions<DateFnsLocale extends DateFnsLocaleBase> = MakeRequired<AdapterOptions<DateFnsLocale, never>, 'locale'> & {
12
+ longFormatters: Record<'p' | 'P', (token: string, formatLong: any) => string>;
13
+ };
14
+ /**
15
+ * Based on `@date-io/date-fns`
16
+ *
17
+ * MIT License
18
+ *
19
+ * Copyright (c) 2017 Dmitriy Kovalenko
20
+ *
21
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
22
+ * of this software and associated documentation files (the "Software"), to deal
23
+ * in the Software without restriction, including without limitation the rights
24
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25
+ * copies of the Software, and to permit persons to whom the Software is
26
+ * furnished to do so, subject to the following conditions:
27
+ *
28
+ * The above copyright notice and this permission notice shall be included in all
29
+ * copies or substantial portions of the Software.
30
+ *
31
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
+ * SOFTWARE.
38
+ */
39
+ export declare class AdapterDateFnsBase<DateFnsLocale extends DateFnsLocaleBase> implements Pick<MuiPickersAdapter<Date, DateFnsLocale>, 'date' | 'dateWithTimezone' | 'getTimezone' | 'setTimezone' | 'toJsDate' | 'getCurrentLocaleCode' | 'is12HourCycleInCurrentLocale' | 'expandFormat' | 'getFormatHelperText' | 'isNull' | 'formatNumber' | 'getMeridiemText'> {
40
+ isMUIAdapter: boolean;
41
+ isTimezoneCompatible: boolean;
42
+ lib: string;
43
+ locale: DateFnsLocale;
44
+ formats: AdapterFormats;
45
+ formatTokenMap: FieldFormatTokenMap;
46
+ escapedCharacters: {
47
+ start: string;
48
+ end: string;
49
+ };
50
+ longFormatters: DateFnsAdapterBaseOptions<DateFnsLocale>['longFormatters'];
51
+ constructor(props: DateFnsAdapterBaseOptions<DateFnsLocale>);
52
+ date: (value?: any) => Date | null;
53
+ dateWithTimezone: <T extends string | null | undefined>(value: T) => DateBuilderReturnType<T, Date>;
54
+ getTimezone: () => string;
55
+ setTimezone: (value: Date) => Date;
56
+ toJsDate: (value: Date) => Date;
57
+ getCurrentLocaleCode: () => string;
58
+ is12HourCycleInCurrentLocale: () => boolean;
59
+ expandFormat: (format: string) => string;
60
+ getFormatHelperText: (format: string) => string;
61
+ isNull: (value: Date | null) => boolean;
62
+ formatNumber: (numberToFormat: string) => string;
63
+ getMeridiemText: (ampm: 'am' | 'pm') => "AM" | "PM";
64
+ }
65
+ export {};