@lazerlen/legend-calendar 1.0.0 → 1.1.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/.turbo/turbo-build.log +14 -13
- package/.turbo/turbo-lint.log +2 -1
- package/.turbo/turbo-test.log +110 -154
- package/.turbo/turbo-typecheck.log +2 -1
- package/dist/index.d.mts +32 -21
- package/dist/index.d.ts +32 -21
- package/dist/index.js +2369 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2336 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -6
- package/src/build/reactCompilerPlugin.ts +53 -0
- package/src/components/Calendar.tsx +9 -5
- package/src/components/CalendarItemDay.tsx +72 -82
- package/src/components/CalendarItemEmpty.tsx +3 -5
- package/src/components/CalendarItemWeekName.tsx +15 -22
- package/src/components/CalendarList.stories.tsx +0 -17
- package/src/components/CalendarList.tsx +84 -133
- package/src/components/CalendarRowMonth.tsx +11 -18
- package/src/components/CalendarRowWeek.tsx +5 -9
- package/src/components/CalendarThemeProvider.tsx +2 -5
- package/src/components/HStack.tsx +13 -26
- package/src/components/Text.tsx +10 -0
- package/src/components/VStack.tsx +10 -36
- package/src/components/index.ts +1 -0
- package/src/hooks/useCalendar.ts +1 -4
- package/src/hooks/useCalendarList.test.ts +31 -1
- package/src/hooks/useCalendarList.tsx +84 -85
- package/src/hooks/useDateRange.ts +58 -63
- package/src/hooks/useOptimizedDayMetadata.test.ts +109 -141
- package/src/hooks/useOptimizedDayMetadata.ts +132 -61
- package/src/index.ts +8 -8
- package/tsconfig.json +1 -1
- package/tsup.config.ts +4 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
[0m[2m[35m$[0m [2m[1mtsup --dts[0m
|
|
2
3
|
[34mCLI[39m Building entry: src/index.ts
|
|
3
4
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
4
|
-
[34mCLI[39m tsup v8.
|
|
5
|
+
[34mCLI[39m tsup v8.5.1
|
|
5
6
|
[34mCLI[39m Using tsup config: /Users/leviwilliams/projects/legend-calendar/packages/legend-calendar/tsup.config.ts
|
|
6
|
-
[34mCLI[39m Target:
|
|
7
|
+
[34mCLI[39m Target: es2016
|
|
7
8
|
[34mCLI[39m Cleaning output folder
|
|
8
9
|
[34mCJS[39m Build start
|
|
9
10
|
[34mESM[39m Build start
|
|
10
|
-
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[32mESM[39m
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
DTS Build start
|
|
12
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m66.59 KB[39m
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m135.15 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 1028ms
|
|
15
|
+
[32mCJS[39m [1mdist/index.js [22m[32m69.65 KB[39m
|
|
16
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m135.66 KB[39m
|
|
17
|
+
[32mCJS[39m ⚡️ Build success in 1028ms
|
|
18
|
+
DTS ⚡️ Build success in 1163ms
|
|
19
|
+
DTS dist/index.d.ts 24.02 KB
|
|
20
|
+
DTS dist/index.d.mts 24.02 KB
|
package/.turbo/turbo-lint.log
CHANGED
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,261 +1,217 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
[0m[2m[35m$[0m [2m[1mbun test[0m
|
|
2
3
|
[0m[1mbun test [0m[2mv1.2.20 (6ad208bc)[0m
|
|
3
4
|
[0m
|
|
4
5
|
src/hooks/useDateRange.test.ts:
|
|
5
6
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
6
7
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
7
|
-
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should initialize with correct default values[0m [0m[2m[
|
|
8
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should initialize with correct default values[0m [0m[2m[4.88ms[0m[2m][0m
|
|
8
9
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
9
10
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
10
11
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
11
12
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
12
13
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
13
14
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
14
|
-
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should update dateRange correctly on onCalendarDayPress[0m [0m[2m[
|
|
15
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should update dateRange correctly on onCalendarDayPress[0m [0m[2m[0.69ms[0m[2m][0m
|
|
15
16
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
16
17
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
17
18
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
18
19
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
19
20
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
20
|
-
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should clear dateRange on onClearDateRange[0m [0m[2m[
|
|
21
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should clear dateRange on onClearDateRange[0m [0m[2m[0.27ms[0m[2m][0m
|
|
21
22
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
22
23
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
23
24
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
24
25
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
25
26
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
26
|
-
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should update isDateRangeValid correctly[0m [0m[2m[0.
|
|
27
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should update isDateRangeValid correctly[0m [0m[2m[0.33ms[0m[2m][0m
|
|
27
28
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
28
29
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
29
|
-
[0m[32m✓[0m [0museDateRange[2m >[0m[1m can initialize a date range[0m [0m[2m[0.
|
|
30
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m can initialize a date range[0m [0m[2m[0.26ms[0m[2m][0m
|
|
30
31
|
[0m
|
|
31
32
|
src/hooks/useCalendarList.test.ts:
|
|
32
|
-
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 5 weeks (no calendar spacing)[0m
|
|
33
|
-
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 5 weeks (with calendar spacing)[0m
|
|
33
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 5 weeks (no calendar spacing)[0m [0m[2m[0.04ms[0m[2m][0m
|
|
34
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 5 weeks (with calendar spacing)[0m [0m[2m[0.01ms[0m[2m][0m
|
|
34
35
|
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Accounts for additional height[0m
|
|
35
|
-
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 6 weeks[0m [0m[2m[0.
|
|
36
|
-
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m February 24 has the right height with base options[0m [0m[2m[0.
|
|
36
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 6 weeks[0m [0m[2m[0.01ms[0m[2m][0m
|
|
37
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m February 24 has the right height with base options[0m [0m[2m[0.40ms[0m[2m][0m
|
|
37
38
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
38
39
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
39
40
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
40
41
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
41
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Max: virtualization still works as expected[0m [0m[2m[
|
|
42
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Max: virtualization still works as expected[0m [0m[2m[0.61ms[0m[2m][0m
|
|
42
43
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
43
44
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
44
45
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
45
46
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
47
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Min: virtualization still works as expected[0m [0m[2m[0.28ms[0m[2m][0m
|
|
48
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
46
49
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
47
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m
|
|
50
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Returns a single month when min and max are in the same month[0m [0m[2m[0.06ms[0m[2m][0m
|
|
48
51
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
49
52
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
50
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Returns a
|
|
53
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Returns a range of months bounded by the min and max dates[0m [0m[2m[0.11ms[0m[2m][0m
|
|
51
54
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
52
55
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
53
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m
|
|
56
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Ignores past/future scroll ranges when min/max dates are used[0m [0m[2m[0.08ms[0m[2m][0m
|
|
54
57
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
55
58
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
56
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m
|
|
59
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Append/Prepend are no-op if min/max are reached[0m [0m[2m[0.11ms[0m[2m][0m
|
|
57
60
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
58
61
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
59
62
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
60
|
-
[0m[
|
|
63
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
64
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Prepend does not trigger a state update when starting month is already present[0m [0m[2m[0.21ms[0m[2m][0m
|
|
61
65
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
62
66
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
63
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mgithub issues[2m >[0m[1m #16: Incorrect scroll position when setting calendarMinDateId[0m [0m[2m[0.
|
|
67
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mgithub issues[2m >[0m[1m #16: Incorrect scroll position when setting calendarMinDateId[0m [0m[2m[0.11ms[0m[2m][0m
|
|
64
68
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
65
69
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
66
|
-
[0m[32m✓[0m [0museCalendarList[2m >[0m[1m Data is correctly built when future/past ranges are 0[0m [0m[2m[0.
|
|
70
|
+
[0m[32m✓[0m [0museCalendarList[2m >[0m[1m Data is correctly built when future/past ranges are 0[0m [0m[2m[0.07ms[0m[2m][0m
|
|
67
71
|
[0m
|
|
68
72
|
src/hooks/useCalendar.test.ts:
|
|
69
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0misLastDayOfWeek[2m >[0m[1m isLastDayOfWeek respects "sunday" as last day of week[0m [0m[2m[
|
|
70
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0misLastDayOfWeek[2m >[0m[1m isLastDayOfWeek respects "monday" as last day of week[0m [0m[2m[1.
|
|
71
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0misWeekend[2m >[0m[1m starting on sunday[0m [0m[2m[1.
|
|
72
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0misWeekend[2m >[0m[1m starting on monday[0m [0m[2m[1.
|
|
73
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes today[0m [0m[2m[1.
|
|
74
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with calendarDisabledDateIds)[0m [0m[2m[1.
|
|
75
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with min)[0m [0m[2m[1.
|
|
76
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with max)[0m [0m[2m[1.
|
|
77
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes idle[0m [0m[2m[1.
|
|
78
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m disabled: supersedes idle[0m [0m[2m[1.
|
|
79
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m today: supersedes idle[0m [0m[2m[1.
|
|
80
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m idle: serves as the base state[0m [0m[2m[
|
|
81
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the month row[0m [0m[2m[1.
|
|
82
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m build the month row with custom formatting[0m [0m[2m[
|
|
83
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the week days row starting on sunday[0m [0m[2m[1.
|
|
84
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the week days row starting on monday[0m [0m[2m[1.
|
|
85
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the weeks row[0m [0m[2m[2.
|
|
86
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m build the weeks row with custom formatting[0m [0m[2m[
|
|
87
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m handles the expected range[0m [0m[2m[
|
|
88
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m calendarMinDate[0m [0m[2m[2.
|
|
89
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m calendarMaxDate[0m [0m[2m[1.
|
|
73
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misLastDayOfWeek[2m >[0m[1m isLastDayOfWeek respects "sunday" as last day of week[0m [0m[2m[7.38ms[0m[2m][0m
|
|
74
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misLastDayOfWeek[2m >[0m[1m isLastDayOfWeek respects "monday" as last day of week[0m [0m[2m[1.09ms[0m[2m][0m
|
|
75
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misWeekend[2m >[0m[1m starting on sunday[0m [0m[2m[1.14ms[0m[2m][0m
|
|
76
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misWeekend[2m >[0m[1m starting on monday[0m [0m[2m[1.20ms[0m[2m][0m
|
|
77
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes today[0m [0m[2m[1.10ms[0m[2m][0m
|
|
78
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with calendarDisabledDateIds)[0m [0m[2m[1.08ms[0m[2m][0m
|
|
79
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with min)[0m [0m[2m[1.53ms[0m[2m][0m
|
|
80
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with max)[0m [0m[2m[1.15ms[0m[2m][0m
|
|
81
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes idle[0m [0m[2m[1.06ms[0m[2m][0m
|
|
82
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m disabled: supersedes idle[0m [0m[2m[1.13ms[0m[2m][0m
|
|
83
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m today: supersedes idle[0m [0m[2m[1.45ms[0m[2m][0m
|
|
84
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m idle: serves as the base state[0m [0m[2m[1.43ms[0m[2m][0m
|
|
85
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the month row[0m [0m[2m[1.02ms[0m[2m][0m
|
|
86
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m build the month row with custom formatting[0m [0m[2m[1.55ms[0m[2m][0m
|
|
87
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the week days row starting on sunday[0m [0m[2m[1.29ms[0m[2m][0m
|
|
88
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the week days row starting on monday[0m [0m[2m[1.48ms[0m[2m][0m
|
|
89
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the weeks row[0m [0m[2m[2.15ms[0m[2m][0m
|
|
90
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m build the weeks row with custom formatting[0m [0m[2m[1.45ms[0m[2m][0m
|
|
91
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m handles the expected range[0m [0m[2m[1.77ms[0m[2m][0m
|
|
92
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m calendarMinDate[0m [0m[2m[2.63ms[0m[2m][0m
|
|
93
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m calendarMaxDate[0m [0m[2m[1.38ms[0m[2m][0m
|
|
90
94
|
[0m
|
|
91
95
|
src/hooks/useOptimizedDayMetadata.test.ts:
|
|
92
96
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
93
97
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
94
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m return the base metadata as the initial value[0m [0m[2m[
|
|
98
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m return the base metadata as the initial value[0m [0m[2m[0.89ms[0m[2m][0m
|
|
95
99
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
96
100
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
97
101
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
98
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
99
102
|
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m if the base changes, the returned value should match it.[0m [0m[2m[0.62ms[0m[2m][0m
|
|
100
103
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
101
104
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
102
105
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
103
|
-
[0m[
|
|
104
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
105
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m endOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.69ms[0m[2m][0m
|
|
106
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m endOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.55ms[0m[2m][0m
|
|
106
107
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
107
108
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
108
109
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
109
|
-
[0m[
|
|
110
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
111
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
112
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m startOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.24ms[0m[2m][0m
|
|
110
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m startOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.17ms[0m[2m][0m
|
|
113
111
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
114
112
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
115
113
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
116
|
-
[0m[
|
|
117
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
118
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
119
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
120
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m startOfRange|endOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.19ms[0m[2m][0m
|
|
114
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m startOfRange|endOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.20ms[0m[2m][0m
|
|
121
115
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
122
116
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
123
117
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
124
|
-
[0m[
|
|
125
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
126
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
127
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
128
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
129
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
130
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
131
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
132
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
133
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
134
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
135
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
136
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
137
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
138
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
139
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
140
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
141
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
142
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
143
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
144
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m doesn't re-render if the active dates don't overlap[0m [0m[2m[1.18ms[0m[2m][0m
|
|
118
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m doesn't re-render if the active dates don't overlap[0m [0m[2m[0.19ms[0m[2m][0m
|
|
145
119
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
146
120
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
147
121
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
148
122
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
149
|
-
[0m[
|
|
150
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
151
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
152
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
153
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
154
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
155
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
156
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
157
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
158
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
159
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
160
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
161
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m resets the state once a new range is selected[0m [0m[2m[1.22ms[0m[2m][0m
|
|
123
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m resets the state once a new range is selected[0m [0m[2m[0.17ms[0m[2m][0m
|
|
162
124
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
163
125
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
164
126
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
165
|
-
[0m[
|
|
166
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
167
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
168
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
169
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
170
|
-
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
171
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m uses the default instance ID when not provided[0m [0m[2m[0.48ms[0m[2m][0m
|
|
127
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m uses the default instance ID when not provided[0m [0m[2m[0.23ms[0m[2m][0m
|
|
172
128
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
173
129
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
174
130
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
175
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m responds to events for the correct instance ID[0m [0m[2m[0.
|
|
131
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m responds to events for the correct instance ID[0m [0m[2m[0.72ms[0m[2m][0m
|
|
176
132
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
177
133
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
178
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m ignores events for different instance IDs[0m [0m[2m[0.
|
|
134
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m ignores events for different instance IDs[0m [0m[2m[0.38ms[0m[2m][0m
|
|
179
135
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
180
136
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
181
137
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
182
138
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
183
139
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
184
140
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
185
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m handles multiple instances correctly[0m [0m[2m[0.
|
|
141
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m handles multiple instances correctly[0m [0m[2m[0.77ms[0m[2m][0m
|
|
186
142
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
187
143
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
188
144
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
189
145
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
190
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m resets state for the correct instance when a new range is selected[0m [0m[2m[0.
|
|
146
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m resets state for the correct instance when a new range is selected[0m [0m[2m[0.65ms[0m[2m][0m
|
|
191
147
|
[0m
|
|
192
148
|
src/helpers/dates.test.ts:
|
|
193
|
-
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m January 1st, 2024[0m [0m[2m[0.
|
|
194
|
-
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m January 31th, 2024[0m [0m[2m[0.
|
|
195
|
-
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m February 1st, 2024[0m [0m[2m[0.
|
|
196
|
-
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m February 10th, 2024[0m [0m[2m[0.
|
|
197
|
-
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m convert between ID -> Date -> ID returns the original result[0m
|
|
198
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m January 1st, 2024[0m [0m[2m[0.
|
|
199
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m January 31th, 2024[0m [0m[2m[0.
|
|
200
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 1st, 2024[0m [0m[2m[0.
|
|
201
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 10th, 2024[0m
|
|
202
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 29th, 2024[0m [0m[2m[0.
|
|
203
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m convert between ID -> Date -> ID returns the original result[0m [0m[2m[0.
|
|
204
|
-
[0m[32m✓[0m [0mfromDateId: UTC time zone[2m >[0m[1m parse Jan 1st[0m [0m[2m[0.
|
|
205
|
-
[0m[32m✓[0m [0mfromDateId: UTC time zone[2m >[0m[1m parses March 1st[0m
|
|
206
|
-
[0m[32m✓[0m [0mfromDateId: Brasilia time zone[2m >[0m[1m parse Jan 1st[0m [0m[2m[0.
|
|
207
|
-
[0m[32m✓[0m [0mfromDateId: Brasilia time zone[2m >[0m[1m parses March 1st[0m [0m[2m[0.
|
|
208
|
-
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m January[0m [0m[2m[0.
|
|
209
|
-
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m February[0m [0m[2m[0.
|
|
210
|
-
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[
|
|
211
|
-
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m January[0m [0m[2m[0.
|
|
149
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m January 1st, 2024[0m [0m[2m[0.08ms[0m[2m][0m
|
|
150
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m January 31th, 2024[0m [0m[2m[0.11ms[0m[2m][0m
|
|
151
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m February 1st, 2024[0m [0m[2m[0.06ms[0m[2m][0m
|
|
152
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m February 10th, 2024[0m [0m[2m[0.07ms[0m[2m][0m
|
|
153
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m convert between ID -> Date -> ID returns the original result[0m [0m[2m[0.04ms[0m[2m][0m
|
|
154
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m January 1st, 2024[0m [0m[2m[0.04ms[0m[2m][0m
|
|
155
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m January 31th, 2024[0m [0m[2m[0.07ms[0m[2m][0m
|
|
156
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 1st, 2024[0m [0m[2m[0.08ms[0m[2m][0m
|
|
157
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 10th, 2024[0m [0m[2m[0.04ms[0m[2m][0m
|
|
158
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 29th, 2024[0m [0m[2m[0.08ms[0m[2m][0m
|
|
159
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m convert between ID -> Date -> ID returns the original result[0m [0m[2m[0.04ms[0m[2m][0m
|
|
160
|
+
[0m[32m✓[0m [0mfromDateId: UTC time zone[2m >[0m[1m parse Jan 1st[0m [0m[2m[0.08ms[0m[2m][0m
|
|
161
|
+
[0m[32m✓[0m [0mfromDateId: UTC time zone[2m >[0m[1m parses March 1st[0m [0m[2m[0.05ms[0m[2m][0m
|
|
162
|
+
[0m[32m✓[0m [0mfromDateId: Brasilia time zone[2m >[0m[1m parse Jan 1st[0m [0m[2m[0.08ms[0m[2m][0m
|
|
163
|
+
[0m[32m✓[0m [0mfromDateId: Brasilia time zone[2m >[0m[1m parses March 1st[0m [0m[2m[0.05ms[0m[2m][0m
|
|
164
|
+
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m January[0m [0m[2m[0.06ms[0m[2m][0m
|
|
165
|
+
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m February[0m [0m[2m[0.03ms[0m[2m][0m
|
|
166
|
+
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[2.44ms[0m[2m][0m
|
|
167
|
+
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m January[0m [0m[2m[0.08ms[0m[2m][0m
|
|
212
168
|
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m February[0m
|
|
213
|
-
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[1.
|
|
214
|
-
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m sunday: week of February 17th[0m [0m[2m[0.
|
|
169
|
+
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[1.33ms[0m[2m][0m
|
|
170
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m sunday: week of February 17th[0m [0m[2m[0.02ms[0m[2m][0m
|
|
215
171
|
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m sunday: week of February 11th[0m
|
|
216
|
-
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m monday: week of February 17th[0m
|
|
217
|
-
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m monday: week of February 11th[0m
|
|
218
|
-
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m matches date-fns[0m [0m[2m[1.
|
|
219
|
-
[0m[32m✓[0m [0maddMonths[2m >[0m[1m add 1 month[0m [0m[2m[0.
|
|
172
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m monday: week of February 17th[0m
|
|
173
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m monday: week of February 11th[0m
|
|
174
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m matches date-fns[0m [0m[2m[1.10ms[0m[2m][0m
|
|
175
|
+
[0m[32m✓[0m [0maddMonths[2m >[0m[1m add 1 month[0m [0m[2m[0.01ms[0m[2m][0m
|
|
220
176
|
[0m[32m✓[0m [0maddMonths[2m >[0m[1m add 10 months[0m
|
|
221
|
-
[0m[32m✓[0m [0maddMonths[2m >[0m[1m matches date-fns[0m [0m[2m[0.
|
|
222
|
-
[0m[32m✓[0m [0msubMonths[2m >[0m[1m sub 1 month[0m [0m[2m[0.
|
|
223
|
-
[0m[32m✓[0m [0msubMonths[2m >[0m[1m sub 10 months[0m [0m[2m[0.
|
|
224
|
-
[0m[32m✓[0m [0msubMonths[2m >[0m[1m matches date-fns[0m [0m[2m[0.
|
|
225
|
-
[0m[32m✓[0m [0maddDays[2m >[0m[1m add 1 day[0m [0m[2m[0.
|
|
177
|
+
[0m[32m✓[0m [0maddMonths[2m >[0m[1m matches date-fns[0m [0m[2m[0.19ms[0m[2m][0m
|
|
178
|
+
[0m[32m✓[0m [0msubMonths[2m >[0m[1m sub 1 month[0m [0m[2m[0.03ms[0m[2m][0m
|
|
179
|
+
[0m[32m✓[0m [0msubMonths[2m >[0m[1m sub 10 months[0m [0m[2m[0.04ms[0m[2m][0m
|
|
180
|
+
[0m[32m✓[0m [0msubMonths[2m >[0m[1m matches date-fns[0m [0m[2m[0.21ms[0m[2m][0m
|
|
181
|
+
[0m[32m✓[0m [0maddDays[2m >[0m[1m add 1 day[0m [0m[2m[0.01ms[0m[2m][0m
|
|
226
182
|
[0m[32m✓[0m [0maddDays[2m >[0m[1m add 10 days[0m
|
|
227
183
|
[0m[32m✓[0m [0maddDays[2m >[0m[1m matches date-fns[0m [0m[2m[0.11ms[0m[2m][0m
|
|
228
|
-
[0m[32m✓[0m [0msubDays[2m >[0m[1m sub 1 day[0m [0m[2m[0.
|
|
229
|
-
[0m[32m✓[0m [0msubDays[2m >[0m[1m sub 10 days[0m
|
|
230
|
-
[0m[32m✓[0m [0msubDays[2m >[0m[1m matches date-fns[0m [0m[2m[0.
|
|
231
|
-
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Friday[0m
|
|
232
|
-
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Saturday[0m
|
|
233
|
-
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Sunday[0m
|
|
234
|
-
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Monday[0m
|
|
235
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Feb 28 2021 and Jan 30 2021[0m
|
|
184
|
+
[0m[32m✓[0m [0msubDays[2m >[0m[1m sub 1 day[0m [0m[2m[0.02ms[0m[2m][0m
|
|
185
|
+
[0m[32m✓[0m [0msubDays[2m >[0m[1m sub 10 days[0m
|
|
186
|
+
[0m[32m✓[0m [0msubDays[2m >[0m[1m matches date-fns[0m [0m[2m[0.08ms[0m[2m][0m
|
|
187
|
+
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Friday[0m
|
|
188
|
+
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Saturday[0m
|
|
189
|
+
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Sunday[0m
|
|
190
|
+
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Monday[0m
|
|
191
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Feb 28 2021 and Jan 30 2021[0m
|
|
236
192
|
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Feb 28 2021 and Jan 31 2021[0m
|
|
237
193
|
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Nov, 30 2021 and Oct, 31 2021[0m
|
|
238
194
|
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Oct, 31 2021 and Sep, 30 2021[0m
|
|
239
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 6 month between Oct, 31 2021 and Apr, 30 2021[0m
|
|
195
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 6 month between Oct, 31 2021 and Apr, 30 2021[0m
|
|
240
196
|
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of -1 month between Sep, 30 2021 and Oct, 31 2021[0m
|
|
241
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m the days of months of the given dates are the same[0m
|
|
242
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m the given dates are the same[0m
|
|
243
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m does not return -0 when the given dates are the same[0m
|
|
244
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m returns the number of full months between the given dates - end of Feb[0m [0m[2m[0.
|
|
245
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns the number of full months between the given dates[0m
|
|
197
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m the days of months of the given dates are the same[0m
|
|
198
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m the given dates are the same[0m
|
|
199
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m does not return -0 when the given dates are the same[0m
|
|
200
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m returns the number of full months between the given dates - end of Feb[0m [0m[2m[0.04ms[0m[2m][0m
|
|
201
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns the number of full months between the given dates[0m
|
|
246
202
|
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns a negative number if the time value of the first date is smaller[0m
|
|
247
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the first date is `Invalid Date`[0m
|
|
248
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the second date is `Invalid Date`[0m
|
|
249
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the both dates are `Invalid Date`[0m
|
|
203
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the first date is `Invalid Date`[0m
|
|
204
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the second date is `Invalid Date`[0m
|
|
205
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the both dates are `Invalid Date`[0m [0m[2m[0.01ms[0m[2m][0m
|
|
250
206
|
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m sunday: Month with 5 weeks[0m [0m[2m[0.03ms[0m[2m][0m
|
|
251
|
-
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m sunday: Month with 6 weeks[0m
|
|
252
|
-
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m monday: Month with 5 weeks[0m [0m[2m[0.
|
|
253
|
-
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m matches date-fns[0m [0m[2m[2.
|
|
254
|
-
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m sunday: June[0m [0m[2m[0.
|
|
255
|
-
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m monday: June[0m
|
|
256
|
-
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[
|
|
207
|
+
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m sunday: Month with 6 weeks[0m
|
|
208
|
+
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m monday: Month with 5 weeks[0m [0m[2m[0.01ms[0m[2m][0m
|
|
209
|
+
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m matches date-fns[0m [0m[2m[2.55ms[0m[2m][0m
|
|
210
|
+
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m sunday: June[0m [0m[2m[0.17ms[0m[2m][0m
|
|
211
|
+
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m monday: June[0m [0m[2m[0.03ms[0m[2m][0m
|
|
212
|
+
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[0.80ms[0m[2m][0m
|
|
257
213
|
|
|
258
|
-
[0m[32m
|
|
214
|
+
[0m[32m 116 pass[0m
|
|
259
215
|
[0m[2m 0 fail[0m
|
|
260
|
-
|
|
261
|
-
Ran
|
|
216
|
+
8696 expect() calls
|
|
217
|
+
Ran 116 tests across 5 files. [0m[2m[[1m121.00ms[0m[2m][0m
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
[0m[2m[35m$[0m [2m[1mtsc --noEmit[0m
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { TextProps, ViewStyle, TextStyle, PressableProps, ColorSchemeName } from 'react-native';
|
|
4
|
+
import { LegendListProps } from '@legendapp/list/react-native';
|
|
4
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
type CalendarTextProps = Omit<TextProps, "onPress" | "onLongPress" | "onPressIn" | "onPressOut">;
|
|
7
8
|
|
|
8
9
|
/** All fields that affects the day's state. */
|
|
9
10
|
interface CalendarDayStateFields {
|
|
@@ -145,7 +146,7 @@ interface CalendarItemDayProps {
|
|
|
145
146
|
/** The cell's height */
|
|
146
147
|
height: number;
|
|
147
148
|
/** Optional TextProps to spread to the <Text> component. */
|
|
148
|
-
textProps?: Omit<
|
|
149
|
+
textProps?: Omit<CalendarTextProps, "children">;
|
|
149
150
|
/** Optional component to replace the default <Pressable> component. */
|
|
150
151
|
CalendarPressableComponent?: PressableLike;
|
|
151
152
|
}
|
|
@@ -157,7 +158,7 @@ interface CalendarItemDayProps {
|
|
|
157
158
|
* `CalendarItemDayWithContainer`, since it also includes the spacing between
|
|
158
159
|
* each day.
|
|
159
160
|
*/
|
|
160
|
-
declare const CalendarItemDay:
|
|
161
|
+
declare const CalendarItemDay: react.NamedExoticComponent<CalendarItemDayProps>;
|
|
161
162
|
interface CalendarItemDayContainerTheme {
|
|
162
163
|
/** An empty view that acts as a spacer between each day. The spacing is
|
|
163
164
|
* controlled by the `daySpacing` prop. */
|
|
@@ -184,7 +185,7 @@ interface CalendarItemDayContainerProps {
|
|
|
184
185
|
/** The metadata for the day, extracted from the calendar's state. */
|
|
185
186
|
metadata?: CalendarDayMetadata;
|
|
186
187
|
}
|
|
187
|
-
declare const CalendarItemDayContainer:
|
|
188
|
+
declare const CalendarItemDayContainer: react.NamedExoticComponent<CalendarItemDayContainerProps>;
|
|
188
189
|
interface CalendarItemDayWithContainerProps extends Omit<CalendarItemDayProps, "height">, Pick<CalendarItemDayContainerProps, "daySpacing" | "dayHeight"> {
|
|
189
190
|
containerTheme?: CalendarItemDayContainerTheme;
|
|
190
191
|
/**
|
|
@@ -200,7 +201,7 @@ interface CalendarItemDayWithContainerProps extends Omit<CalendarItemDayProps, "
|
|
|
200
201
|
*/
|
|
201
202
|
calendarInstanceId?: string;
|
|
202
203
|
}
|
|
203
|
-
declare const CalendarItemDayWithContainer:
|
|
204
|
+
declare const CalendarItemDayWithContainer: react.NamedExoticComponent<CalendarItemDayWithContainerProps>;
|
|
204
205
|
|
|
205
206
|
interface CalendarItemEmptyProps {
|
|
206
207
|
/** The height of the cell. Should be the same as `CalendarItemDay`. */
|
|
@@ -225,9 +226,9 @@ interface CalendarItemWeekNameProps {
|
|
|
225
226
|
/** The theme of the week name, useful for customizing the component. */
|
|
226
227
|
theme?: CalendarItemWeekNameTheme;
|
|
227
228
|
/** Optional TextProps to spread to the <Text> component. */
|
|
228
|
-
textProps?: Omit<
|
|
229
|
+
textProps?: Omit<CalendarTextProps, "children">;
|
|
229
230
|
}
|
|
230
|
-
declare const CalendarItemWeekName:
|
|
231
|
+
declare const CalendarItemWeekName: react.NamedExoticComponent<CalendarItemWeekNameProps>;
|
|
231
232
|
|
|
232
233
|
interface CalendarRowMonthTheme {
|
|
233
234
|
container?: ViewStyle;
|
|
@@ -243,7 +244,7 @@ interface CalendarRowMonthProps {
|
|
|
243
244
|
/** The theme of the month row, useful for customizing the component. */
|
|
244
245
|
theme?: CalendarRowMonthTheme;
|
|
245
246
|
}
|
|
246
|
-
declare const CalendarRowMonth:
|
|
247
|
+
declare const CalendarRowMonth: react.NamedExoticComponent<CalendarRowMonthProps>;
|
|
247
248
|
|
|
248
249
|
/**
|
|
249
250
|
* Minimal theme for the Legend Calendar component.
|
|
@@ -329,7 +330,7 @@ interface CalendarRowWeekProps {
|
|
|
329
330
|
interface CalendarRowWeekTheme {
|
|
330
331
|
container?: ViewStyle;
|
|
331
332
|
}
|
|
332
|
-
declare const CalendarRowWeek:
|
|
333
|
+
declare const CalendarRowWeek: react.NamedExoticComponent<CalendarRowWeekProps>;
|
|
333
334
|
|
|
334
335
|
type PressableLike = React.ComponentType<Pick<PressableProps, "children" | "style" | "disabled"> & {
|
|
335
336
|
onPress: () => void;
|
|
@@ -620,25 +621,35 @@ declare function toDateId(date: Date): string;
|
|
|
620
621
|
*/
|
|
621
622
|
declare function fromDateId(dateId: string): Date;
|
|
622
623
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
624
|
+
/**
|
|
625
|
+
* A lightweight store for active date ranges. This replaces the mitt emitter
|
|
626
|
+
* with a more efficient useSyncExternalStore-compatible pattern.
|
|
627
|
+
*/
|
|
628
|
+
declare class DateRangeStore {
|
|
629
|
+
private stores;
|
|
630
|
+
private getOrCreateStore;
|
|
631
|
+
setRanges(instanceId: string, ranges: CalendarActiveDateRange[]): void;
|
|
632
|
+
private rangesEqual;
|
|
633
|
+
getSnapshot(instanceId: string): CalendarActiveDateRange[];
|
|
634
|
+
getDaySnapshot(instanceId: string, baseMetadata: CalendarDayMetadata): CalendarDayMetadata;
|
|
635
|
+
subscribe(instanceId: string, callback: () => void): () => void;
|
|
636
|
+
/**
|
|
637
|
+
* Clears all stores. Useful for testing.
|
|
638
|
+
*/
|
|
639
|
+
clear(): void;
|
|
626
640
|
}
|
|
627
641
|
/**
|
|
628
|
-
*
|
|
629
|
-
*
|
|
642
|
+
* A store for active date ranges. This notifies calendar items when their state
|
|
643
|
+
* changes, allowing just the affected items to re-render.
|
|
630
644
|
*
|
|
631
645
|
* While this is an implementation detail focused on improving performance, it's
|
|
632
646
|
* exported in case you need to build your own calendar. Check the source code
|
|
633
647
|
* for a reference implementation.
|
|
634
648
|
*/
|
|
635
|
-
declare const
|
|
636
|
-
onSetActiveDateRanges: OnSetActiveDateRangesPayload;
|
|
637
|
-
}>;
|
|
649
|
+
declare const activeDateRangesStore: DateRangeStore;
|
|
638
650
|
/**
|
|
639
651
|
* Returns an optimized metadata for a particular day. This hook listens to the
|
|
640
|
-
*
|
|
641
|
-
* re-render.
|
|
652
|
+
* date range store, enabling only the affected calendar items to re-render.
|
|
642
653
|
*
|
|
643
654
|
* While this is an implementation detail focused on improving performance, it's
|
|
644
655
|
* exported in case you need to build your own calendar. Check the source code
|
|
@@ -676,4 +687,4 @@ declare const useDateRange: (initialDateRange?: CalendarActiveDateRange) => {
|
|
|
676
687
|
isDateRangeValid: boolean;
|
|
677
688
|
};
|
|
678
689
|
|
|
679
|
-
export { Calendar, type CalendarActiveDateRange, type CalendarDayMetadata, type CalendarItemDayContainerProps, type CalendarItemDayProps, type CalendarItemDayWithContainerProps, type CalendarItemEmptyProps, type CalendarItemWeekNameProps, type CalendarListProps, type CalendarListRef, type CalendarMonth, type CalendarMonthEnhanced, type CalendarOnDayPress, type CalendarProps, type CalendarRowMonthProps, type CalendarRowWeekProps, type CalendarTheme, type HStackProps, type UseCalendarListParams, type UseCalendarParams, type VStackProps,
|
|
690
|
+
export { Calendar, type CalendarActiveDateRange, type CalendarDayMetadata, type CalendarItemDayContainerProps, type CalendarItemDayProps, type CalendarItemDayWithContainerProps, type CalendarItemEmptyProps, type CalendarItemWeekNameProps, type CalendarListProps, type CalendarListRef, type CalendarMonth, type CalendarMonthEnhanced, type CalendarOnDayPress, type CalendarProps, type CalendarRowMonthProps, type CalendarRowWeekProps, type CalendarTextProps, type CalendarTheme, type HStackProps, type UseCalendarListParams, type UseCalendarParams, type VStackProps, activeDateRangesStore, buildCalendar, fromDateId, getHeightForMonth, toDateId, useCalendar, useCalendarList, useDateRange, useOptimizedDayMetadata };
|