mui-temporal-pickers 1.0.0 → 1.0.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.
package/dist/adapters/base.js
CHANGED
|
@@ -181,7 +181,7 @@ export class AdapterTemporalBase {
|
|
|
181
181
|
return this.dateOperations.getDaysInMonth(value);
|
|
182
182
|
}
|
|
183
183
|
getWeekNumber(value) {
|
|
184
|
-
return this.dateOperations.getWeekNumber(value
|
|
184
|
+
return this.dateOperations.getWeekNumber(value);
|
|
185
185
|
}
|
|
186
186
|
getDayOfWeek(value) {
|
|
187
187
|
return this.dateOperations.getDayOfWeek(value);
|
|
@@ -34,7 +34,7 @@ export type AdapterDateOperations<T extends ValidTemporal> = {
|
|
|
34
34
|
getMonth: (value: T) => number;
|
|
35
35
|
getDate: (value: T) => number;
|
|
36
36
|
getDaysInMonth: (value: T) => number;
|
|
37
|
-
getWeekNumber: (value: T
|
|
37
|
+
getWeekNumber: (value: T) => number;
|
|
38
38
|
getDayOfWeek: (value: T) => number;
|
|
39
39
|
setYear: (value: T, year: number) => T;
|
|
40
40
|
setMonth: (value: T, month: number) => T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { firstDayOfMonth, firstDayOfWeek, firstDayOfYear, lastDayOfMonth, lastDayOfWeek, lastDayOfYear,
|
|
1
|
+
import { firstDayOfMonth, firstDayOfWeek, firstDayOfYear, lastDayOfMonth, lastDayOfWeek, lastDayOfYear, } from "temporal-extra";
|
|
2
2
|
export const noopAdapterDateOperations = {
|
|
3
3
|
startOfYear: (value) => value,
|
|
4
4
|
startOfMonth: (value) => value,
|
|
@@ -37,7 +37,12 @@ export const defaultAdapterDateOperations = {
|
|
|
37
37
|
getMonth: (value) => value.month,
|
|
38
38
|
getDate: (value) => value.day,
|
|
39
39
|
getDaysInMonth: (value) => value.daysInMonth,
|
|
40
|
-
getWeekNumber: (value
|
|
40
|
+
getWeekNumber: (value) => {
|
|
41
|
+
if (!value.weekOfYear) {
|
|
42
|
+
throw new Error("Date is in a calendar system without weeks");
|
|
43
|
+
}
|
|
44
|
+
return value.weekOfYear;
|
|
45
|
+
},
|
|
41
46
|
getDayOfWeek: (value) => value.dayOfWeek,
|
|
42
47
|
setYear: (value, year) => value.with({ year }),
|
|
43
48
|
setMonth: (value, month) => value.with({ month }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mui-temporal-pickers",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A small utility library providing Temporal support for MUI X Date and Time Pickers",
|
|
5
5
|
"author": "Ben Scholzen 'DASPRiD'",
|
|
6
6
|
"keywords": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"license": "BSD-2-Clause",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/
|
|
18
|
+
"url": "git+https://github.com/DASPRiD/mui-temporal-pickers.git"
|
|
19
19
|
},
|
|
20
20
|
"type": "module",
|
|
21
21
|
"sideEffects": false,
|