-
I've read the documentation and searched through the code but I'm struggling to figure out how to programmatically set the visible month, or months. How can I configure the calendar to display a specific date range based on some state, for example, a URL param? In the screenshot below for example I would like the calendar to display the months Dec 2023 and Jan 2024, rather than Oct and Nov 2023. ![]() I'm using the Calendar built with Tailwind, supporting multiple visible months example as a starting point. When setting state.visibleRange.start = state.visibleRange.start.add({ months: 2 });
state.visibleRange.end = state.visibleRange.end.add({ months: 2 }); Calling state.setValue(parseDate("2023-12-01")); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It looks like the prop I was overlooking is |
Beta Was this translation helpful? Give feedback.
-
Actually, using Is there a way to always make the month with the focused date appear on the left? |
Beta Was this translation helpful? Give feedback.
It looks like the prop I was overlooking is
defaultFocusedValue
. I've solved the problem I was having by settingdefaultFocusedValue
to the first day of the first month I want to be visible, and passing this touseCalendar()
. The calendar then displays that month.