@lazerlen/legend-calendar 1.1.1 → 1.2.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.
@@ -9,12 +9,12 @@
9
9
  CJS Build start
10
10
  ESM Build start
11
11
  DTS Build start
12
- CJS dist/index.js 69.65 KB
13
- CJS dist/index.js.map 135.66 KB
14
- CJS ⚡️ Build success in 1240ms
15
- ESM dist/index.mjs 66.59 KB
16
- ESM dist/index.mjs.map 135.15 KB
17
- ESM ⚡️ Build success in 1241ms
18
- DTS ⚡️ Build success in 1352ms
19
- DTS dist/index.d.ts 24.02 KB
20
- DTS dist/index.d.mts 24.02 KB
12
+ ESM dist/index.mjs 70.25 KB
13
+ ESM dist/index.mjs.map 140.21 KB
14
+ ESM ⚡️ Build success in 1089ms
15
+ CJS dist/index.js 73.30 KB
16
+ CJS dist/index.js.map 140.74 KB
17
+ CJS ⚡️ Build success in 1089ms
18
+ DTS ⚡️ Build success in 1185ms
19
+ DTS dist/index.d.ts 24.07 KB
20
+ DTS dist/index.d.mts 24.07 KB
@@ -5,41 +5,41 @@
5
5
  src/hooks/useDateRange.test.ts:
6
6
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
7
7
  The current testing environment is not configured to support act(...)
8
- ✓ useDateRange > should initialize with correct default values [6.68ms]
8
+ ✓ useDateRange > should initialize with correct default values [5.48ms]
9
9
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
10
10
  The current testing environment is not configured to support act(...)
11
11
  The current testing environment is not configured to support act(...)
12
12
  The current testing environment is not configured to support act(...)
13
13
  The current testing environment is not configured to support act(...)
14
14
  The current testing environment is not configured to support act(...)
15
- ✓ useDateRange > should update dateRange correctly on onCalendarDayPress [1.52ms]
15
+ ✓ useDateRange > should update dateRange correctly on onCalendarDayPress [1.31ms]
16
16
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
17
17
  The current testing environment is not configured to support act(...)
18
18
  The current testing environment is not configured to support act(...)
19
19
  The current testing environment is not configured to support act(...)
20
20
  The current testing environment is not configured to support act(...)
21
- ✓ useDateRange > should clear dateRange on onClearDateRange [0.97ms]
21
+ ✓ useDateRange > should clear dateRange on onClearDateRange [1.09ms]
22
22
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
23
23
  The current testing environment is not configured to support act(...)
24
24
  The current testing environment is not configured to support act(...)
25
25
  The current testing environment is not configured to support act(...)
26
26
  The current testing environment is not configured to support act(...)
27
- ✓ useDateRange > should update isDateRangeValid correctly [0.64ms]
27
+ ✓ useDateRange > should update isDateRangeValid correctly [0.34ms]
28
28
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
29
29
  The current testing environment is not configured to support act(...)
30
- ✓ useDateRange > can initialize a date range [0.24ms]
30
+ ✓ useDateRange > can initialize a date range [0.12ms]
31
31
  
32
32
  src/hooks/useCalendarList.test.ts:
33
- ✓ getHeightForMonth > Measures months with 5 weeks (no calendar spacing) [0.14ms]
34
- ✓ getHeightForMonth > Measures months with 5 weeks (with calendar spacing)
33
+ ✓ getHeightForMonth > Measures months with 5 weeks (no calendar spacing) [0.12ms]
34
+ ✓ getHeightForMonth > Measures months with 5 weeks (with calendar spacing) [0.10ms]
35
35
  ✓ getHeightForMonth > Accounts for additional height [0.02ms]
36
- ✓ getHeightForMonth > Measures months with 6 weeks
37
- ✓ getHeightForMonth > February 24 has the right height with base options [0.63ms]
36
+ ✓ getHeightForMonth > Measures months with 6 weeks [0.01ms]
37
+ ✓ getHeightForMonth > February 24 has the right height with base options [0.42ms]
38
38
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
39
39
  The current testing environment is not configured to support act(...)
40
40
  The current testing environment is not configured to support act(...)
41
41
  The current testing environment is not configured to support act(...)
42
- ✓ useCalendarList > Min/Max dates > Max: virtualization still works as expected [1.34ms]
42
+ ✓ useCalendarList > Min/Max dates > Max: virtualization still works as expected [0.84ms]
43
43
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
44
44
  The current testing environment is not configured to support act(...)
45
45
  The current testing environment is not configured to support act(...)
@@ -47,171 +47,171 @@ src/hooks/useCalendarList.test.ts:
47
47
  ✓ useCalendarList > Min/Max dates > Min: virtualization still works as expected [0.32ms]
48
48
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
49
49
  The current testing environment is not configured to support act(...)
50
- ✓ useCalendarList > Min/Max dates > Returns a single month when min and max are in the same month [0.13ms]
50
+ ✓ useCalendarList > Min/Max dates > Returns a single month when min and max are in the same month [0.09ms]
51
51
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
52
52
  The current testing environment is not configured to support act(...)
53
- ✓ useCalendarList > Min/Max dates > Returns a range of months bounded by the min and max dates [0.10ms]
53
+ ✓ useCalendarList > Min/Max dates > Returns a range of months bounded by the min and max dates [0.07ms]
54
54
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
55
55
  The current testing environment is not configured to support act(...)
56
- ✓ useCalendarList > Min/Max dates > Ignores past/future scroll ranges when min/max dates are used [0.07ms]
56
+ ✓ useCalendarList > Min/Max dates > Ignores past/future scroll ranges when min/max dates are used [0.13ms]
57
57
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
58
58
  The current testing environment is not configured to support act(...)
59
- ✓ useCalendarList > Min/Max dates > Append/Prepend are no-op if min/max are reached [0.28ms]
59
+ ✓ useCalendarList > Min/Max dates > Append/Prepend are no-op if min/max are reached [0.24ms]
60
60
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
61
61
  The current testing environment is not configured to support act(...)
62
62
  The current testing environment is not configured to support act(...)
63
63
  The current testing environment is not configured to support act(...)
64
- ✓ useCalendarList > Min/Max dates > Prepend does not trigger a state update when starting month is already present [0.61ms]
64
+ ✓ useCalendarList > Min/Max dates > Prepend does not trigger a state update when starting month is already present [0.24ms]
65
65
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
66
66
  The current testing environment is not configured to support act(...)
67
- ✓ useCalendarList > github issues > #16: Incorrect scroll position when setting calendarMinDateId [0.53ms]
67
+ ✓ useCalendarList > github issues > #16: Incorrect scroll position when setting calendarMinDateId [0.14ms]
68
68
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
69
69
  The current testing environment is not configured to support act(...)
70
- ✓ useCalendarList > Data is correctly built when future/past ranges are 0 [0.38ms]
70
+ ✓ useCalendarList > Data is correctly built when future/past ranges are 0 [0.07ms]
71
71
  
72
72
  src/hooks/useCalendar.test.ts:
73
- ✓ buildCalendar > isLastDayOfWeek > isLastDayOfWeek respects "sunday" as last day of week [10.57ms]
74
- ✓ buildCalendar > isLastDayOfWeek > isLastDayOfWeek respects "monday" as last day of week [1.18ms]
75
- ✓ buildCalendar > isWeekend > starting on sunday [1.42ms]
76
- ✓ buildCalendar > isWeekend > starting on monday [1.09ms]
77
- ✓ buildCalendar > state > active: supersedes today [1.12ms]
78
- ✓ buildCalendar > state > active: supersedes disabled (with calendarDisabledDateIds) [0.90ms]
79
- ✓ buildCalendar > state > active: supersedes disabled (with min) [1.58ms]
80
- ✓ buildCalendar > state > active: supersedes disabled (with max) [1.67ms]
81
- ✓ buildCalendar > state > active: supersedes idle [1.11ms]
82
- ✓ buildCalendar > state > disabled: supersedes idle [1.51ms]
83
- ✓ buildCalendar > state > today: supersedes idle [2.27ms]
84
- ✓ buildCalendar > state > idle: serves as the base state [2.32ms]
85
- ✓ buildCalendar > builds the month row [1.22ms]
86
- ✓ buildCalendar > build the month row with custom formatting [2.95ms]
87
- ✓ buildCalendar > builds the week days row starting on sunday [1.22ms]
88
- ✓ buildCalendar > builds the week days row starting on monday [1.05ms]
89
- ✓ buildCalendar > builds the weeks row [1.35ms]
90
- ✓ buildCalendar > build the weeks row with custom formatting [0.72ms]
91
- ✓ buildCalendar > handles the expected range [0.71ms]
92
- ✓ buildCalendar > calendarMinDate [1.55ms]
93
- ✓ buildCalendar > calendarMaxDate [2.01ms]
73
+ ✓ buildCalendar > isLastDayOfWeek > isLastDayOfWeek respects "sunday" as last day of week [10.22ms]
74
+ ✓ buildCalendar > isLastDayOfWeek > isLastDayOfWeek respects "monday" as last day of week [2.35ms]
75
+ ✓ buildCalendar > isWeekend > starting on sunday [1.85ms]
76
+ ✓ buildCalendar > isWeekend > starting on monday [1.28ms]
77
+ ✓ buildCalendar > state > active: supersedes today [1.16ms]
78
+ ✓ buildCalendar > state > active: supersedes disabled (with calendarDisabledDateIds) [0.86ms]
79
+ ✓ buildCalendar > state > active: supersedes disabled (with min) [0.91ms]
80
+ ✓ buildCalendar > state > active: supersedes disabled (with max) [1.55ms]
81
+ ✓ buildCalendar > state > active: supersedes idle [1.43ms]
82
+ ✓ buildCalendar > state > disabled: supersedes idle [1.37ms]
83
+ ✓ buildCalendar > state > today: supersedes idle [1.11ms]
84
+ ✓ buildCalendar > state > idle: serves as the base state [2.84ms]
85
+ ✓ buildCalendar > builds the month row [1.65ms]
86
+ ✓ buildCalendar > build the month row with custom formatting [3.22ms]
87
+ ✓ buildCalendar > builds the week days row starting on sunday [1.42ms]
88
+ ✓ buildCalendar > builds the week days row starting on monday [1.50ms]
89
+ ✓ buildCalendar > builds the weeks row [1.34ms]
90
+ ✓ buildCalendar > build the weeks row with custom formatting [0.53ms]
91
+ ✓ buildCalendar > handles the expected range [1.23ms]
92
+ ✓ buildCalendar > calendarMinDate [1.27ms]
93
+ ✓ buildCalendar > calendarMaxDate [1.18ms]
94
94
  
95
95
  src/hooks/useOptimizedDayMetadata.test.ts:
96
96
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
97
97
  The current testing environment is not configured to support act(...)
98
- ✓ useOptimizedDayMetadata > return the base metadata as the initial value [1.00ms]
98
+ ✓ useOptimizedDayMetadata > return the base metadata as the initial value [1.42ms]
99
99
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
100
100
  The current testing environment is not configured to support act(...)
101
101
  The current testing environment is not configured to support act(...)
102
- ✓ useOptimizedDayMetadata > if the base changes, the returned value should match it. [1.37ms]
102
+ ✓ useOptimizedDayMetadata > if the base changes, the returned value should match it. [0.92ms]
103
103
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
104
104
  The current testing environment is not configured to support act(...)
105
105
  The current testing environment is not configured to support act(...)
106
- ✓ useOptimizedDayMetadata > endOfRange: returns the updated metadata once an event is emitted [1.08ms]
106
+ ✓ useOptimizedDayMetadata > endOfRange: returns the updated metadata once an event is emitted [0.67ms]
107
107
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
108
108
  The current testing environment is not configured to support act(...)
109
109
  The current testing environment is not configured to support act(...)
110
- ✓ useOptimizedDayMetadata > startOfRange: returns the updated metadata once an event is emitted [0.43ms]
110
+ ✓ useOptimizedDayMetadata > startOfRange: returns the updated metadata once an event is emitted [0.33ms]
111
111
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
112
112
  The current testing environment is not configured to support act(...)
113
113
  The current testing environment is not configured to support act(...)
114
- ✓ useOptimizedDayMetadata > startOfRange|endOfRange: returns the updated metadata once an event is emitted [0.17ms]
114
+ ✓ useOptimizedDayMetadata > startOfRange|endOfRange: returns the updated metadata once an event is emitted [0.14ms]
115
115
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
116
116
  The current testing environment is not configured to support act(...)
117
117
  The current testing environment is not configured to support act(...)
118
- ✓ useOptimizedDayMetadata > doesn't re-render if the active dates don't overlap [0.24ms]
118
+ ✓ useOptimizedDayMetadata > doesn't re-render if the active dates don't overlap [0.16ms]
119
119
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
120
120
  The current testing environment is not configured to support act(...)
121
121
  The current testing environment is not configured to support act(...)
122
122
  The current testing environment is not configured to support act(...)
123
- ✓ useOptimizedDayMetadata > resets the state once a new range is selected [0.34ms]
123
+ ✓ useOptimizedDayMetadata > resets the state once a new range is selected [0.14ms]
124
124
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
125
125
  The current testing environment is not configured to support act(...)
126
126
  The current testing environment is not configured to support act(...)
127
- ✓ useOptimizedDayMetadata with calendarInstanceId > uses the default instance ID when not provided [0.39ms]
127
+ ✓ useOptimizedDayMetadata with calendarInstanceId > uses the default instance ID when not provided [0.10ms]
128
128
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
129
129
  The current testing environment is not configured to support act(...)
130
130
  The current testing environment is not configured to support act(...)
131
- ✓ useOptimizedDayMetadata with calendarInstanceId > responds to events for the correct instance ID [0.28ms]
131
+ ✓ useOptimizedDayMetadata with calendarInstanceId > responds to events for the correct instance ID [0.08ms]
132
132
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
133
133
  The current testing environment is not configured to support act(...)
134
- ✓ useOptimizedDayMetadata with calendarInstanceId > ignores events for different instance IDs [0.13ms]
134
+ ✓ useOptimizedDayMetadata with calendarInstanceId > ignores events for different instance IDs [0.06ms]
135
135
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
136
136
  The current testing environment is not configured to support act(...)
137
137
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
138
138
  The current testing environment is not configured to support act(...)
139
139
  The current testing environment is not configured to support act(...)
140
140
  The current testing environment is not configured to support act(...)
141
- ✓ useOptimizedDayMetadata with calendarInstanceId > handles multiple instances correctly [0.23ms]
141
+ ✓ useOptimizedDayMetadata with calendarInstanceId > handles multiple instances correctly [0.17ms]
142
142
  react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer
143
143
  The current testing environment is not configured to support act(...)
144
144
  The current testing environment is not configured to support act(...)
145
145
  The current testing environment is not configured to support act(...)
146
- ✓ useOptimizedDayMetadata with calendarInstanceId > resets state for the correct instance when a new range is selected [0.10ms]
146
+ ✓ useOptimizedDayMetadata with calendarInstanceId > resets state for the correct instance when a new range is selected [0.12ms]
147
147
  
148
148
  src/helpers/dates.test.ts:
149
- ✓ toDateId: UTC time zone > January 1st, 2024
150
- ✓ toDateId: UTC time zone > January 31th, 2024
149
+ ✓ toDateId: UTC time zone > January 1st, 2024 [0.14ms]
150
+ ✓ toDateId: UTC time zone > January 31th, 2024 [0.02ms]
151
151
  ✓ toDateId: UTC time zone > February 1st, 2024
152
152
  ✓ toDateId: UTC time zone > February 10th, 2024
153
- ✓ toDateId: UTC time zone > convert between ID -> Date -> ID returns the original result
153
+ ✓ toDateId: UTC time zone > convert between ID -> Date -> ID returns the original result [0.01ms]
154
154
  ✓ toDateId: Brasilia time zone  > January 1st, 2024
155
- ✓ toDateId: Brasilia time zone  > January 31th, 2024 [0.02ms]
155
+ ✓ toDateId: Brasilia time zone  > January 31th, 2024 [0.01ms]
156
156
  ✓ toDateId: Brasilia time zone  > February 1st, 2024
157
- ✓ toDateId: Brasilia time zone  > February 10th, 2024
158
- ✓ toDateId: Brasilia time zone  > February 29th, 2024 [0.03ms]
159
- ✓ toDateId: Brasilia time zone  > convert between ID -> Date -> ID returns the original result [0.03ms]
157
+ ✓ toDateId: Brasilia time zone  > February 10th, 2024 [0.01ms]
158
+ ✓ toDateId: Brasilia time zone  > February 29th, 2024 [0.01ms]
159
+ ✓ toDateId: Brasilia time zone  > convert between ID -> Date -> ID returns the original result [0.02ms]
160
160
  ✓ fromDateId: UTC time zone > parse Jan 1st [0.02ms]
161
- ✓ fromDateId: UTC time zone > parses March 1st
162
- ✓ fromDateId: Brasilia time zone > parse Jan 1st [0.03ms]
161
+ ✓ fromDateId: UTC time zone > parses March 1st [0.02ms]
162
+ ✓ fromDateId: Brasilia time zone > parse Jan 1st
163
163
  ✓ fromDateId: Brasilia time zone > parses March 1st
164
- ✓ startOfMonth > January [0.04ms]
164
+ ✓ startOfMonth > January [0.02ms]
165
165
  ✓ startOfMonth > February [0.01ms]
166
- ✓ startOfMonth > matches date-fns [1.95ms]
167
- ✓ endOfMonth > January [0.05ms]
166
+ ✓ startOfMonth > matches date-fns [1.58ms]
167
+ ✓ endOfMonth > January [0.04ms]
168
168
  ✓ endOfMonth > February [0.03ms]
169
- ✓ endOfMonth > matches date-fns [1.29ms]
169
+ ✓ endOfMonth > matches date-fns [1.11ms]
170
170
  ✓ startOfWeek > sunday: week of February 17th [0.02ms]
171
- ✓ startOfWeek > sunday: week of February 11th [0.08ms]
172
- ✓ startOfWeek > monday: week of February 17th [0.05ms]
171
+ ✓ startOfWeek > sunday: week of February 11th
172
+ ✓ startOfWeek > monday: week of February 17th
173
173
  ✓ startOfWeek > monday: week of February 11th [0.01ms]
174
- ✓ startOfWeek > matches date-fns [1.61ms]
175
- ✓ addMonths > add 1 month [0.13ms]
176
- ✓ addMonths > add 10 months [0.05ms]
177
- ✓ addMonths > matches date-fns [0.28ms]
178
- ✓ subMonths > sub 1 month [0.14ms]
179
- ✓ subMonths > sub 10 months [0.03ms]
180
- ✓ subMonths > matches date-fns [0.49ms]
181
- ✓ addDays > add 1 day [0.05ms]
182
- ✓ addDays > add 10 days [0.04ms]
183
- ✓ addDays > matches date-fns [0.28ms]
184
- ✓ subDays > sub 1 day [0.05ms]
185
- ✓ subDays > sub 10 days [0.03ms]
186
- ✓ subDays > matches date-fns [0.30ms]
187
- ✓ isWeekend > Friday [0.03ms]
188
- ✓ isWeekend > Saturday [0.02ms]
189
- ✓ isWeekend > Sunday [0.01ms]
190
- ✓ isWeekend > Monday [0.02ms]
174
+ ✓ startOfWeek > matches date-fns [1.21ms]
175
+ ✓ addMonths > add 1 month [0.03ms]
176
+ ✓ addMonths > add 10 months [0.04ms]
177
+ ✓ addMonths > matches date-fns [0.18ms]
178
+ ✓ subMonths > sub 1 month
179
+ ✓ subMonths > sub 10 months
180
+ ✓ subMonths > matches date-fns [0.27ms]
181
+ ✓ addDays > add 1 day [0.03ms]
182
+ ✓ addDays > add 10 days [0.01ms]
183
+ ✓ addDays > matches date-fns [0.09ms]
184
+ ✓ subDays > sub 1 day [0.01ms]
185
+ ✓ subDays > sub 10 days
186
+ ✓ subDays > matches date-fns [0.08ms]
187
+ ✓ isWeekend > Friday
188
+ ✓ isWeekend > Saturday
189
+ ✓ isWeekend > Sunday
190
+ ✓ isWeekend > Monday
191
191
  ✓ differenceInMonths  > edge cases > it returns diff of 1 month between Feb 28 2021 and Jan 30 2021 [0.01ms]
192
- ✓ differenceInMonths  > edge cases > it returns diff of 1 month between Feb 28 2021 and Jan 31 2021 [0.01ms]
193
- ✓ differenceInMonths  > edge cases > it returns diff of 1 month between Nov, 30 2021 and Oct, 31 2021 [0.01ms]
194
- ✓ differenceInMonths  > edge cases > it returns diff of 1 month between Oct, 31 2021 and Sep, 30 2021 [0.02ms]
195
- ✓ differenceInMonths  > edge cases > it returns diff of 6 month between Oct, 31 2021 and Apr, 30 2021 [0.03ms]
196
- ✓ differenceInMonths  > edge cases > it returns diff of -1 month between Sep, 30 2021 and Oct, 31 2021 [0.02ms]
192
+ ✓ differenceInMonths  > edge cases > it returns diff of 1 month between Feb 28 2021 and Jan 31 2021
193
+ ✓ differenceInMonths  > edge cases > it returns diff of 1 month between Nov, 30 2021 and Oct, 31 2021
194
+ ✓ differenceInMonths  > edge cases > it returns diff of 1 month between Oct, 31 2021 and Sep, 30 2021
195
+ ✓ differenceInMonths  > edge cases > it returns diff of 6 month between Oct, 31 2021 and Apr, 30 2021
196
+ ✓ differenceInMonths  > edge cases > it returns diff of -1 month between Sep, 30 2021 and Oct, 31 2021
197
197
  ✓ differenceInMonths  > edge cases > the days of months of the given dates are the same
198
198
  ✓ differenceInMonths  > edge cases > the given dates are the same
199
- ✓ differenceInMonths  > edge cases > does not return -0 when the given dates are the same [0.02ms]
199
+ ✓ differenceInMonths  > edge cases > does not return -0 when the given dates are the same [0.01ms]
200
200
  ✓ differenceInMonths  > edge cases > returns the number of full months between the given dates - end of Feb [0.02ms]
201
- ✓ differenceInMonths  > returns the number of full months between the given dates [0.02ms]
202
- ✓ differenceInMonths  > returns a negative number if the time value of the first date is smaller [0.01ms]
203
- ✓ differenceInMonths  > returns NaN if the first date is `Invalid Date` [0.16ms]
204
- ✓ differenceInMonths  > returns NaN if the second date is `Invalid Date` [0.03ms]
201
+ ✓ differenceInMonths  > returns the number of full months between the given dates
202
+ ✓ differenceInMonths  > returns a negative number if the time value of the first date is smaller
203
+ ✓ differenceInMonths  > returns NaN if the first date is `Invalid Date`
204
+ ✓ differenceInMonths  > returns NaN if the second date is `Invalid Date`
205
205
  ✓ differenceInMonths  > returns NaN if the both dates are `Invalid Date`
206
- ✓ getWeeksInMonth > sunday: Month with 5 weeks [0.03ms]
207
- ✓ getWeeksInMonth > sunday: Month with 6 weeks [0.02ms]
208
- ✓ getWeeksInMonth > monday: Month with 5 weeks [0.04ms]
209
- ✓ getWeeksInMonth > matches date-fns [2.66ms]
210
- ✓ getWeekOfMonth > sunday: June [0.11ms]
211
- ✓ getWeekOfMonth > monday: June [0.03ms]
212
- ✓ getWeekOfMonth > matches date-fns [0.75ms]
206
+ ✓ getWeeksInMonth > sunday: Month with 5 weeks
207
+ ✓ getWeeksInMonth > sunday: Month with 6 weeks
208
+ ✓ getWeeksInMonth > monday: Month with 5 weeks
209
+ ✓ getWeeksInMonth > matches date-fns [2.19ms]
210
+ ✓ getWeekOfMonth > sunday: June [0.21ms]
211
+ ✓ getWeekOfMonth > monday: June [0.06ms]
212
+ ✓ getWeekOfMonth > matches date-fns [0.65ms]
213
213
 
214
214
   116 pass
215
215
   0 fail
216
216
  8696 expect() calls
217
- Ran 116 tests across 5 files. [203.00ms]
217
+ Ran 116 tests across 5 files. [178.00ms]
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
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';
5
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
+ import { LegendListProps } from '@legendapp/list/react-native';
6
6
 
7
7
  type CalendarTextProps = Omit<TextProps, "onPress" | "onLongPress" | "onPressIn" | "onPressOut">;
8
8
 
@@ -131,7 +131,7 @@ declare module "react-native" {
131
131
  }
132
132
  type DayState = "idle" | "active" | "today" | "disabled";
133
133
  interface DayTheme {
134
- container: Omit<ViewStyle, "borderRadius">;
134
+ container: ViewStyle;
135
135
  content: TextStyle;
136
136
  }
137
137
  interface CalendarItemDayProps {
@@ -162,7 +162,7 @@ declare const CalendarItemDay: react.NamedExoticComponent<CalendarItemDayProps>;
162
162
  interface CalendarItemDayContainerTheme {
163
163
  /** An empty view that acts as a spacer between each day. The spacing is
164
164
  * controlled by the `daySpacing` prop. */
165
- spacer?: ViewStyle;
165
+ spacer?: ViewStyle | ((params: CalendarDayMetadata) => ViewStyle);
166
166
  /** An absolute positioned filler to join the active days together in a single
167
167
  * complete range. */
168
168
  activeDayFiller?: ViewStyle | ((params: CalendarDayMetadata) => ViewStyle);
@@ -538,9 +538,9 @@ interface CalendarListRef {
538
538
  scrollToDate: (date: Date, animated: boolean, params?: ImperativeScrollParams) => void;
539
539
  scrollToOffset: (offset: number, animated: boolean) => void;
540
540
  }
541
- declare const CalendarList: react.NamedExoticComponent<CalendarListProps & {
541
+ declare function CalendarList({ ref, ...props }: CalendarListProps & {
542
542
  ref?: React.Ref<CalendarListRef>;
543
- }>;
543
+ }): react_jsx_runtime.JSX.Element;
544
544
 
545
545
  interface HStackProps {
546
546
  alignItems?: ViewStyle["alignItems"];
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
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';
5
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
+ import { LegendListProps } from '@legendapp/list/react-native';
6
6
 
7
7
  type CalendarTextProps = Omit<TextProps, "onPress" | "onLongPress" | "onPressIn" | "onPressOut">;
8
8
 
@@ -131,7 +131,7 @@ declare module "react-native" {
131
131
  }
132
132
  type DayState = "idle" | "active" | "today" | "disabled";
133
133
  interface DayTheme {
134
- container: Omit<ViewStyle, "borderRadius">;
134
+ container: ViewStyle;
135
135
  content: TextStyle;
136
136
  }
137
137
  interface CalendarItemDayProps {
@@ -162,7 +162,7 @@ declare const CalendarItemDay: react.NamedExoticComponent<CalendarItemDayProps>;
162
162
  interface CalendarItemDayContainerTheme {
163
163
  /** An empty view that acts as a spacer between each day. The spacing is
164
164
  * controlled by the `daySpacing` prop. */
165
- spacer?: ViewStyle;
165
+ spacer?: ViewStyle | ((params: CalendarDayMetadata) => ViewStyle);
166
166
  /** An absolute positioned filler to join the active days together in a single
167
167
  * complete range. */
168
168
  activeDayFiller?: ViewStyle | ((params: CalendarDayMetadata) => ViewStyle);
@@ -538,9 +538,9 @@ interface CalendarListRef {
538
538
  scrollToDate: (date: Date, animated: boolean, params?: ImperativeScrollParams) => void;
539
539
  scrollToOffset: (offset: number, animated: boolean) => void;
540
540
  }
541
- declare const CalendarList: react.NamedExoticComponent<CalendarListProps & {
541
+ declare function CalendarList({ ref, ...props }: CalendarListProps & {
542
542
  ref?: React.Ref<CalendarListRef>;
543
- }>;
543
+ }): react_jsx_runtime.JSX.Element;
544
544
 
545
545
  interface HStackProps {
546
546
  alignItems?: ViewStyle["alignItems"];