@mui/x-date-pickers 7.0.0-alpha.6 → 7.0.0-alpha.8

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 (128) hide show
  1. package/AdapterDateFns/AdapterDateFns.d.ts +4 -21
  2. package/AdapterDateFns/AdapterDateFns.js +11 -255
  3. package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +62 -0
  4. package/AdapterDateFnsBase/AdapterDateFnsBase.js +291 -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 +80 -0
  10. package/AdapterDateFnsV3/AdapterDateFnsV3.js +287 -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/CHANGELOG.md +357 -49
  15. package/DateCalendar/DateCalendar.js +6 -4
  16. package/DateCalendar/DateCalendar.types.d.ts +0 -8
  17. package/DatePicker/DatePickerToolbar.d.ts +2 -2
  18. package/DatePicker/DatePickerToolbar.js +2 -7
  19. package/DigitalClock/DigitalClock.js +4 -2
  20. package/DigitalClock/DigitalClock.types.d.ts +5 -0
  21. package/LocalizationProvider/LocalizationProvider.js +1 -1
  22. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -13
  23. package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +5 -0
  24. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +4 -8
  25. package/PickersSectionList/PickersSectionList.js +1 -1
  26. package/TimeClock/TimeClock.js +4 -2
  27. package/TimeClock/TimeClock.types.d.ts +5 -0
  28. package/hooks/useClearableField.js +3 -3
  29. package/index.js +1 -1
  30. package/internals/components/PickersInput/PickersFilledInput.js +2 -2
  31. package/internals/components/PickersInput/PickersInput.d.ts +2 -4
  32. package/internals/components/PickersInput/PickersInput.js +2 -3
  33. package/internals/components/PickersInput/PickersStandardInput.js +2 -2
  34. package/internals/hooks/useField/useField.utils.js +5 -5
  35. package/internals/hooks/usePicker/index.d.ts +1 -1
  36. package/internals/hooks/usePicker/usePickerValue.js +2 -2
  37. package/internals/hooks/useUtils.js +2 -2
  38. package/internals/hooks/useViews.d.ts +4 -4
  39. package/internals/hooks/useViews.js +15 -15
  40. package/internals/index.d.ts +9 -3
  41. package/internals/index.js +6 -2
  42. package/internals/models/common.d.ts +1 -1
  43. package/internals/models/helpers.d.ts +1 -0
  44. package/internals/models/props/clock.d.ts +0 -9
  45. package/internals/utils/views.js +1 -1
  46. package/legacy/AdapterDateFns/AdapterDateFns.js +222 -458
  47. package/legacy/AdapterDateFnsBase/AdapterDateFnsBase.js +293 -0
  48. package/legacy/AdapterDateFnsBase/index.js +1 -0
  49. package/legacy/AdapterDateFnsV3/AdapterDateFnsV3.js +306 -0
  50. package/legacy/AdapterDateFnsV3/index.js +1 -0
  51. package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +5 -6
  52. package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +5 -6
  53. package/legacy/DateCalendar/DateCalendar.js +6 -4
  54. package/legacy/DatePicker/DatePickerToolbar.js +2 -7
  55. package/legacy/DigitalClock/DigitalClock.js +4 -2
  56. package/legacy/LocalizationProvider/LocalizationProvider.js +1 -1
  57. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -13
  58. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +4 -8
  59. package/legacy/PickersSectionList/PickersSectionList.js +1 -1
  60. package/legacy/TimeClock/TimeClock.js +4 -2
  61. package/legacy/hooks/useClearableField.js +3 -3
  62. package/legacy/index.js +1 -1
  63. package/legacy/internals/components/PickersInput/PickersFilledInput.js +2 -2
  64. package/legacy/internals/components/PickersInput/PickersInput.js +2 -3
  65. package/legacy/internals/components/PickersInput/PickersStandardInput.js +2 -2
  66. package/legacy/internals/hooks/useField/useField.utils.js +5 -5
  67. package/legacy/internals/hooks/usePicker/usePickerValue.js +2 -2
  68. package/legacy/internals/hooks/useUtils.js +2 -2
  69. package/legacy/internals/hooks/useViews.js +15 -15
  70. package/legacy/internals/index.js +6 -2
  71. package/legacy/internals/utils/views.js +1 -1
  72. package/legacy/locales/index.js +1 -0
  73. package/locales/enUS.d.ts +1 -1
  74. package/locales/index.d.ts +1 -0
  75. package/locales/index.js +1 -0
  76. package/locales/mk.d.ts +1 -1
  77. package/locales/utils/getPickersLocalization.d.ts +1 -1
  78. package/modern/AdapterDateFns/AdapterDateFns.js +11 -254
  79. package/modern/AdapterDateFnsBase/AdapterDateFnsBase.js +290 -0
  80. package/modern/AdapterDateFnsBase/index.js +1 -0
  81. package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +287 -0
  82. package/modern/AdapterDateFnsV3/index.js +1 -0
  83. package/modern/DateCalendar/DateCalendar.js +6 -4
  84. package/modern/DatePicker/DatePickerToolbar.js +2 -7
  85. package/modern/DigitalClock/DigitalClock.js +4 -2
  86. package/modern/LocalizationProvider/LocalizationProvider.js +1 -1
  87. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -13
  88. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +4 -8
  89. package/modern/PickersSectionList/PickersSectionList.js +1 -1
  90. package/modern/TimeClock/TimeClock.js +4 -2
  91. package/modern/hooks/useClearableField.js +3 -3
  92. package/modern/index.js +1 -1
  93. package/modern/internals/components/PickersInput/PickersFilledInput.js +2 -2
  94. package/modern/internals/components/PickersInput/PickersInput.js +2 -3
  95. package/modern/internals/components/PickersInput/PickersStandardInput.js +2 -2
  96. package/modern/internals/hooks/useField/useField.utils.js +5 -5
  97. package/modern/internals/hooks/usePicker/usePickerValue.js +2 -2
  98. package/modern/internals/hooks/useUtils.js +2 -2
  99. package/modern/internals/hooks/useViews.js +15 -15
  100. package/modern/internals/index.js +6 -2
  101. package/modern/internals/utils/views.js +1 -1
  102. package/modern/locales/index.js +1 -0
  103. package/node/AdapterDateFns/AdapterDateFns.js +11 -254
  104. package/node/AdapterDateFnsBase/AdapterDateFnsBase.js +298 -0
  105. package/node/AdapterDateFnsBase/index.js +12 -0
  106. package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +295 -0
  107. package/node/AdapterDateFnsV3/index.js +12 -0
  108. package/node/DateCalendar/DateCalendar.js +6 -4
  109. package/node/DatePicker/DatePickerToolbar.js +0 -4
  110. package/node/DigitalClock/DigitalClock.js +4 -2
  111. package/node/LocalizationProvider/LocalizationProvider.js +1 -1
  112. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -13
  113. package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +4 -8
  114. package/node/PickersSectionList/PickersSectionList.js +1 -1
  115. package/node/TimeClock/TimeClock.js +4 -2
  116. package/node/hooks/useClearableField.js +3 -3
  117. package/node/index.js +1 -1
  118. package/node/internals/components/PickersInput/PickersFilledInput.js +2 -2
  119. package/node/internals/components/PickersInput/PickersInput.js +2 -3
  120. package/node/internals/components/PickersInput/PickersStandardInput.js +2 -2
  121. package/node/internals/hooks/useField/useField.utils.js +5 -5
  122. package/node/internals/hooks/usePicker/usePickerValue.js +2 -2
  123. package/node/internals/hooks/useUtils.js +2 -2
  124. package/node/internals/hooks/useViews.js +15 -15
  125. package/node/internals/index.js +47 -1
  126. package/node/internals/utils/views.js +1 -1
  127. package/node/locales/index.js +11 -0
  128. package/package.json +6 -6
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/AdapterDateFnsBase/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -1,3 +1,4 @@
1
+ /// <reference types="date-fns-jalali" />
1
2
  import defaultLocale from 'date-fns-jalali/locale/fa-IR';
2
3
  import { AdapterFormats, AdapterOptions, DateBuilderReturnType, FieldFormatTokenMap, MuiPickersAdapter } from '../models';
3
4
  type DateFnsLocale = typeof defaultLocale;
@@ -0,0 +1,80 @@
1
+ import { Locale as DateFnsLocale } from 'date-fns/locale/types';
2
+ import { AdapterFormats, AdapterOptions, MuiPickersAdapter } from '../models';
3
+ import { AdapterDateFnsBase } from '../AdapterDateFnsBase';
4
+ /**
5
+ * Based on `@date-io/date-fns`
6
+ *
7
+ * MIT License
8
+ *
9
+ * Copyright (c) 2017 Dmitriy Kovalenko
10
+ *
11
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ * of this software and associated documentation files (the "Software"), to deal
13
+ * in the Software without restriction, including without limitation the rights
14
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ * copies of the Software, and to permit persons to whom the Software is
16
+ * furnished to do so, subject to the following conditions:
17
+ *
18
+ * The above copyright notice and this permission notice shall be included in all
19
+ * copies or substantial portions of the Software.
20
+ *
21
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ * SOFTWARE.
28
+ */
29
+ export declare class AdapterDateFns extends AdapterDateFnsBase<DateFnsLocale> implements MuiPickersAdapter<Date, DateFnsLocale> {
30
+ constructor({ locale, formats }?: AdapterOptions<DateFnsLocale, never>);
31
+ parse: (value: string, format: string) => any;
32
+ isValid: (value: Date | null) => any;
33
+ format: (value: Date, formatKey: keyof AdapterFormats) => any;
34
+ formatByString: (value: Date, formatString: string) => any;
35
+ isEqual: (value: Date | null, comparing: Date | null) => any;
36
+ isSameYear: (value: Date, comparing: Date) => any;
37
+ isSameMonth: (value: Date, comparing: Date) => any;
38
+ isSameDay: (value: Date, comparing: Date) => any;
39
+ isSameHour: (value: Date, comparing: Date) => any;
40
+ isAfter: (value: Date, comparing: Date) => any;
41
+ isAfterYear: (value: Date, comparing: Date) => any;
42
+ isAfterDay: (value: Date, comparing: Date) => any;
43
+ isBefore: (value: Date, comparing: Date) => any;
44
+ isBeforeYear: (value: Date, comparing: Date) => any;
45
+ isBeforeDay: (value: Date, comparing: Date) => any;
46
+ isWithinRange: (value: Date, [start, end]: [Date, Date]) => any;
47
+ startOfYear: (value: Date) => any;
48
+ startOfMonth: (value: Date) => any;
49
+ startOfWeek: (value: Date) => any;
50
+ startOfDay: (value: Date) => any;
51
+ endOfYear: (value: Date) => any;
52
+ endOfMonth: (value: Date) => any;
53
+ endOfWeek: (value: Date) => any;
54
+ endOfDay: (value: Date) => any;
55
+ addYears: (value: Date, amount: number) => any;
56
+ addMonths: (value: Date, amount: number) => any;
57
+ addWeeks: (value: Date, amount: number) => any;
58
+ addDays: (value: Date, amount: number) => any;
59
+ addHours: (value: Date, amount: number) => any;
60
+ addMinutes: (value: Date, amount: number) => any;
61
+ addSeconds: (value: Date, amount: number) => any;
62
+ getYear: (value: Date) => any;
63
+ getMonth: (value: Date) => any;
64
+ getDate: (value: Date) => any;
65
+ getHours: (value: Date) => any;
66
+ getMinutes: (value: Date) => any;
67
+ getSeconds: (value: Date) => any;
68
+ getMilliseconds: (value: Date) => any;
69
+ setYear: (value: Date, year: number) => any;
70
+ setMonth: (value: Date, month: number) => any;
71
+ setDate: (value: Date, date: number) => any;
72
+ setHours: (value: Date, hours: number) => any;
73
+ setMinutes: (value: Date, minutes: number) => any;
74
+ setSeconds: (value: Date, seconds: number) => any;
75
+ setMilliseconds: (value: Date, milliseconds: number) => any;
76
+ getDaysInMonth: (value: Date) => any;
77
+ getWeekArray: (value: Date) => Date[][];
78
+ getWeekNumber: (value: Date) => any;
79
+ getYearRange: ([start, end]: [Date, Date]) => Date[];
80
+ }
@@ -0,0 +1,287 @@
1
+ /* eslint-disable class-methods-use-this */
2
+ // TODO remove when date-fns-v3 is the default
3
+ // @ts-nocheck
4
+ import { addDays } from 'date-fns/addDays';
5
+ import { addSeconds } from 'date-fns/addSeconds';
6
+ import { addMinutes } from 'date-fns/addMinutes';
7
+ import { addHours } from 'date-fns/addHours';
8
+ import { addWeeks } from 'date-fns/addWeeks';
9
+ import { addMonths } from 'date-fns/addMonths';
10
+ import { addYears } from 'date-fns/addYears';
11
+ import { endOfDay } from 'date-fns/endOfDay';
12
+ import { endOfWeek } from 'date-fns/endOfWeek';
13
+ import { endOfYear } from 'date-fns/endOfYear';
14
+ // @ts-ignore TODO remove when date-fns-v3 is the default
15
+ import { format as dateFnsFormat, longFormatters } from 'date-fns/format';
16
+ import { getDate } from 'date-fns/getDate';
17
+ import { getDaysInMonth } from 'date-fns/getDaysInMonth';
18
+ import { getHours } from 'date-fns/getHours';
19
+ import { getMinutes } from 'date-fns/getMinutes';
20
+ import { getMonth } from 'date-fns/getMonth';
21
+ import { getSeconds } from 'date-fns/getSeconds';
22
+ import { getMilliseconds } from 'date-fns/getMilliseconds';
23
+ import { getWeek } from 'date-fns/getWeek';
24
+ import { getYear } from 'date-fns/getYear';
25
+ import { isAfter } from 'date-fns/isAfter';
26
+ import { isBefore } from 'date-fns/isBefore';
27
+ import { isEqual } from 'date-fns/isEqual';
28
+ import { isSameDay } from 'date-fns/isSameDay';
29
+ import { isSameYear } from 'date-fns/isSameYear';
30
+ import { isSameMonth } from 'date-fns/isSameMonth';
31
+ import { isSameHour } from 'date-fns/isSameHour';
32
+ import { isValid } from 'date-fns/isValid';
33
+ import { parse as dateFnsParse } from 'date-fns/parse';
34
+ import { setDate } from 'date-fns/setDate';
35
+ import { setHours } from 'date-fns/setHours';
36
+ import { setMinutes } from 'date-fns/setMinutes';
37
+ import { setMonth } from 'date-fns/setMonth';
38
+ import { setSeconds } from 'date-fns/setSeconds';
39
+ import { setMilliseconds } from 'date-fns/setMilliseconds';
40
+ import { setYear } from 'date-fns/setYear';
41
+ import { startOfDay } from 'date-fns/startOfDay';
42
+ import { startOfMonth } from 'date-fns/startOfMonth';
43
+ import { endOfMonth } from 'date-fns/endOfMonth';
44
+ import { startOfWeek } from 'date-fns/startOfWeek';
45
+ import { startOfYear } from 'date-fns/startOfYear';
46
+ import { isWithinInterval } from 'date-fns/isWithinInterval';
47
+ import { enUS } from 'date-fns/locale/en-US';
48
+ // date-fns v2 does not export types
49
+ // @ts-ignore TODO remove when date-fns-v3 is the default
50
+
51
+ import { AdapterDateFnsBase } from '../AdapterDateFnsBase';
52
+
53
+ /**
54
+ * Based on `@date-io/date-fns`
55
+ *
56
+ * MIT License
57
+ *
58
+ * Copyright (c) 2017 Dmitriy Kovalenko
59
+ *
60
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
61
+ * of this software and associated documentation files (the "Software"), to deal
62
+ * in the Software without restriction, including without limitation the rights
63
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
64
+ * copies of the Software, and to permit persons to whom the Software is
65
+ * furnished to do so, subject to the following conditions:
66
+ *
67
+ * The above copyright notice and this permission notice shall be included in all
68
+ * copies or substantial portions of the Software.
69
+ *
70
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
71
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
72
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
73
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
74
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
75
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
76
+ * SOFTWARE.
77
+ */
78
+ export class AdapterDateFns extends AdapterDateFnsBase {
79
+ constructor({
80
+ locale,
81
+ formats
82
+ } = {}) {
83
+ if (typeof addDays !== 'function') {
84
+ throw new Error([`MUI: The \`date-fns\` package v2.x is not compatible with this adapter.`, 'Please, install v3.x of the package or use the `AdapterDateFns` instead.'].join('\n'));
85
+ }
86
+ if (!longFormatters) {
87
+ throw new Error('MUI: The minimum supported `date-fns` package version compatible with this adapter is `3.2.x`.');
88
+ }
89
+ super({
90
+ locale: locale != null ? locale : enUS,
91
+ formats,
92
+ longFormatters
93
+ });
94
+ this.parse = (value, format) => {
95
+ if (value === '') {
96
+ return null;
97
+ }
98
+ return dateFnsParse(value, format, new Date(), {
99
+ locale: this.locale
100
+ });
101
+ };
102
+ this.isValid = value => {
103
+ if (value == null) {
104
+ return false;
105
+ }
106
+ return isValid(value);
107
+ };
108
+ this.format = (value, formatKey) => {
109
+ return this.formatByString(value, this.formats[formatKey]);
110
+ };
111
+ this.formatByString = (value, formatString) => {
112
+ return dateFnsFormat(value, formatString, {
113
+ locale: this.locale
114
+ });
115
+ };
116
+ this.isEqual = (value, comparing) => {
117
+ if (value === null && comparing === null) {
118
+ return true;
119
+ }
120
+ if (value === null || comparing === null) {
121
+ return false;
122
+ }
123
+ return isEqual(value, comparing);
124
+ };
125
+ this.isSameYear = (value, comparing) => {
126
+ return isSameYear(value, comparing);
127
+ };
128
+ this.isSameMonth = (value, comparing) => {
129
+ return isSameMonth(value, comparing);
130
+ };
131
+ this.isSameDay = (value, comparing) => {
132
+ return isSameDay(value, comparing);
133
+ };
134
+ this.isSameHour = (value, comparing) => {
135
+ return isSameHour(value, comparing);
136
+ };
137
+ this.isAfter = (value, comparing) => {
138
+ return isAfter(value, comparing);
139
+ };
140
+ this.isAfterYear = (value, comparing) => {
141
+ return isAfter(value, endOfYear(comparing));
142
+ };
143
+ this.isAfterDay = (value, comparing) => {
144
+ return isAfter(value, endOfDay(comparing));
145
+ };
146
+ this.isBefore = (value, comparing) => {
147
+ return isBefore(value, comparing);
148
+ };
149
+ this.isBeforeYear = (value, comparing) => {
150
+ return isBefore(value, this.startOfYear(comparing));
151
+ };
152
+ this.isBeforeDay = (value, comparing) => {
153
+ return isBefore(value, this.startOfDay(comparing));
154
+ };
155
+ this.isWithinRange = (value, [start, end]) => {
156
+ return isWithinInterval(value, {
157
+ start,
158
+ end
159
+ });
160
+ };
161
+ this.startOfYear = value => {
162
+ return startOfYear(value);
163
+ };
164
+ this.startOfMonth = value => {
165
+ return startOfMonth(value);
166
+ };
167
+ this.startOfWeek = value => {
168
+ return startOfWeek(value, {
169
+ locale: this.locale
170
+ });
171
+ };
172
+ this.startOfDay = value => {
173
+ return startOfDay(value);
174
+ };
175
+ this.endOfYear = value => {
176
+ return endOfYear(value);
177
+ };
178
+ this.endOfMonth = value => {
179
+ return endOfMonth(value);
180
+ };
181
+ this.endOfWeek = value => {
182
+ return endOfWeek(value, {
183
+ locale: this.locale
184
+ });
185
+ };
186
+ this.endOfDay = value => {
187
+ return endOfDay(value);
188
+ };
189
+ this.addYears = (value, amount) => {
190
+ return addYears(value, amount);
191
+ };
192
+ this.addMonths = (value, amount) => {
193
+ return addMonths(value, amount);
194
+ };
195
+ this.addWeeks = (value, amount) => {
196
+ return addWeeks(value, amount);
197
+ };
198
+ this.addDays = (value, amount) => {
199
+ return addDays(value, amount);
200
+ };
201
+ this.addHours = (value, amount) => {
202
+ return addHours(value, amount);
203
+ };
204
+ this.addMinutes = (value, amount) => {
205
+ return addMinutes(value, amount);
206
+ };
207
+ this.addSeconds = (value, amount) => {
208
+ return addSeconds(value, amount);
209
+ };
210
+ this.getYear = value => {
211
+ return getYear(value);
212
+ };
213
+ this.getMonth = value => {
214
+ return getMonth(value);
215
+ };
216
+ this.getDate = value => {
217
+ return getDate(value);
218
+ };
219
+ this.getHours = value => {
220
+ return getHours(value);
221
+ };
222
+ this.getMinutes = value => {
223
+ return getMinutes(value);
224
+ };
225
+ this.getSeconds = value => {
226
+ return getSeconds(value);
227
+ };
228
+ this.getMilliseconds = value => {
229
+ return getMilliseconds(value);
230
+ };
231
+ this.setYear = (value, year) => {
232
+ return setYear(value, year);
233
+ };
234
+ this.setMonth = (value, month) => {
235
+ return setMonth(value, month);
236
+ };
237
+ this.setDate = (value, date) => {
238
+ return setDate(value, date);
239
+ };
240
+ this.setHours = (value, hours) => {
241
+ return setHours(value, hours);
242
+ };
243
+ this.setMinutes = (value, minutes) => {
244
+ return setMinutes(value, minutes);
245
+ };
246
+ this.setSeconds = (value, seconds) => {
247
+ return setSeconds(value, seconds);
248
+ };
249
+ this.setMilliseconds = (value, milliseconds) => {
250
+ return setMilliseconds(value, milliseconds);
251
+ };
252
+ this.getDaysInMonth = value => {
253
+ return getDaysInMonth(value);
254
+ };
255
+ this.getWeekArray = value => {
256
+ const start = this.startOfWeek(this.startOfMonth(value));
257
+ const end = this.endOfWeek(this.endOfMonth(value));
258
+ let count = 0;
259
+ let current = start;
260
+ const nestedWeeks = [];
261
+ while (this.isBefore(current, end)) {
262
+ const weekNumber = Math.floor(count / 7);
263
+ nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
264
+ nestedWeeks[weekNumber].push(current);
265
+ current = this.addDays(current, 1);
266
+ count += 1;
267
+ }
268
+ return nestedWeeks;
269
+ };
270
+ this.getWeekNumber = value => {
271
+ return getWeek(value, {
272
+ locale: this.locale
273
+ });
274
+ };
275
+ this.getYearRange = ([start, end]) => {
276
+ const startDate = this.startOfYear(start);
277
+ const endDate = this.endOfYear(end);
278
+ const years = [];
279
+ let current = startDate;
280
+ while (this.isBefore(current, endDate)) {
281
+ years.push(current);
282
+ current = this.addYears(current, 1);
283
+ }
284
+ return years;
285
+ };
286
+ }
287
+ }
@@ -0,0 +1 @@
1
+ export { AdapterDateFns } from './AdapterDateFnsV3';
@@ -0,0 +1 @@
1
+ export { AdapterDateFns } from './AdapterDateFnsV3';
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/AdapterDateFnsV3/index.js",
5
+ "types": "./index.d.ts"
6
+ }