Skip to content

Commit 3e18878

Browse files
authored
Fix wrong month setting at examples (#2019)
Without these changes instead of adding 1 month, we were adding 2 months
1 parent 828ed4a commit 3e18878

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

example/src/screens/calendarScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ const CalendarScreen = () => {
430430

431431
const setCustomHeaderNewMonth = (next = false) => {
432432
const add = next ? 1 : -1;
433-
const month = customHeaderProps?.current?.month;
433+
const month = new Date(customHeaderProps?.current?.month);
434434
const newMonth = new Date(month.setMonth(month.getMonth() + add));
435435
customHeaderProps?.current?.addMonth(add);
436436
setCurrentMonth(newMonth.toISOString().split('T')[0]);

0 commit comments

Comments
 (0)