@mui/x-date-pickers 6.18.7 → 6.19.0
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.d.ts +3 -24
- package/AdapterDateFns/AdapterDateFns.js +11 -272
- package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +65 -0
- package/AdapterDateFnsBase/AdapterDateFnsBase.js +308 -0
- package/AdapterDateFnsBase/index.d.ts +1 -0
- package/AdapterDateFnsBase/index.js +1 -0
- package/AdapterDateFnsBase/package.json +6 -0
- package/AdapterDateFnsV3/AdapterDateFnsV3.d.ts +88 -0
- package/AdapterDateFnsV3/AdapterDateFnsV3.js +357 -0
- package/AdapterDateFnsV3/index.d.ts +1 -0
- package/AdapterDateFnsV3/index.js +1 -0
- package/AdapterDateFnsV3/package.json +6 -0
- package/CHANGELOG.md +42 -0
- package/hooks/useClearableField.d.ts +1 -1
- package/hooks/useClearableField.js +3 -3
- package/index.js +1 -1
- package/internals/models/helpers.d.ts +1 -0
- package/legacy/AdapterDateFns/AdapterDateFns.js +278 -528
- package/legacy/AdapterDateFnsBase/AdapterDateFnsBase.js +308 -0
- package/legacy/AdapterDateFnsBase/index.js +1 -0
- package/legacy/AdapterDateFnsV3/AdapterDateFnsV3.js +376 -0
- package/legacy/AdapterDateFnsV3/index.js +1 -0
- package/legacy/hooks/useClearableField.js +3 -3
- package/legacy/index.js +1 -1
- package/legacy/locales/index.js +1 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/modern/AdapterDateFns/AdapterDateFns.js +11 -271
- package/modern/AdapterDateFnsBase/AdapterDateFnsBase.js +307 -0
- package/modern/AdapterDateFnsBase/index.js +1 -0
- package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +357 -0
- package/modern/AdapterDateFnsV3/index.js +1 -0
- package/modern/hooks/useClearableField.js +3 -3
- package/modern/index.js +1 -1
- package/modern/locales/index.js +1 -0
- package/node/AdapterDateFns/AdapterDateFns.js +11 -271
- package/node/AdapterDateFnsBase/AdapterDateFnsBase.js +315 -0
- package/node/AdapterDateFnsBase/index.js +12 -0
- package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +366 -0
- package/node/AdapterDateFnsV3/index.js +12 -0
- package/node/hooks/useClearableField.js +3 -3
- package/node/index.js +1 -1
- package/node/locales/index.js +11 -0
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import defaultLocale from 'date-fns/locale/en-US';
|
|
2
|
-
import { AdapterFormats, AdapterOptions, AdapterUnits,
|
|
2
|
+
import { AdapterFormats, AdapterOptions, AdapterUnits, MuiPickersAdapter } from '../models';
|
|
3
|
+
import { AdapterDateFnsBase } from '../AdapterDateFnsBase';
|
|
3
4
|
type DateFnsLocale = typeof defaultLocale;
|
|
4
5
|
/**
|
|
5
6
|
* Based on `@date-io/date-fns`
|
|
@@ -26,35 +27,14 @@ type DateFnsLocale = typeof defaultLocale;
|
|
|
26
27
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
28
|
* SOFTWARE.
|
|
28
29
|
*/
|
|
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
|
-
};
|
|
30
|
+
export declare class AdapterDateFns extends AdapterDateFnsBase<DateFnsLocale> implements MuiPickersAdapter<Date, DateFnsLocale> {
|
|
40
31
|
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
32
|
parseISO: (isoString: string) => Date;
|
|
47
33
|
toISO: (value: Date) => string;
|
|
48
34
|
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
35
|
isValid: (value: any) => boolean;
|
|
55
36
|
format: (value: Date, formatKey: keyof AdapterFormats) => string;
|
|
56
37
|
formatByString: (value: Date, formatString: string) => string;
|
|
57
|
-
formatNumber: (numberToFormat: string) => string;
|
|
58
38
|
getDiff: (value: Date, comparing: Date | string, unit?: AdapterUnits) => number;
|
|
59
39
|
isEqual: (value: any, comparing: any) => boolean;
|
|
60
40
|
isSameYear: (value: Date, comparing: Date) => boolean;
|
|
@@ -106,6 +86,5 @@ export declare class AdapterDateFns implements MuiPickersAdapter<Date, DateFnsLo
|
|
|
106
86
|
getWeekArray: (value: Date) => Date[][];
|
|
107
87
|
getWeekNumber: (value: Date) => number;
|
|
108
88
|
getYearRange: (start: Date, end: Date) => Date[];
|
|
109
|
-
getMeridiemText: (ampm: 'am' | 'pm') => "AM" | "PM";
|
|
110
89
|
}
|
|
111
90
|
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
|
-
|
|
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
|
|
87
|
+
locale,
|
|
284
88
|
formats
|
|
285
89
|
} = {}) {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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 {};
|