Skip to content

Commit 9c2a466

Browse files
authored
fix(#2050): prevent date overflow when the current date day is 31 (#2051)
1 parent 95f7e99 commit 9c2a466

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/calendar-list/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ const CalendarList = (props: CalendarListProps, ref: any) => {
214214

215215
const isDateInRange = useCallback((date) => {
216216
for(let i = -range.current; i <= range.current; i++) {
217-
const newMonth = currentMonth?.clone().addMonths(i);
217+
const newMonth = currentMonth?.clone().addMonths(i, true);
218218
if (sameMonth(date, newMonth)) {
219219
return true;
220220
}

0 commit comments

Comments
 (0)