Calendar
Single date selection
Date range selection
Date range selection and two months view
Component API
Calendar component props
| Prop | Default | Description |
onClick | — | onClick: (date: CalendarDateValue) => voidCallback function to be called when the calendar date is clicked |
mode | date | date | rangeThe mode of the calendar. Select single date or date range. |
weekStartsOn | — | 1 | 2 | 3 | 4 | 5 | 6 | 7The day of the week to start on. Default is 1 (Monday) |
value | undefined | Date | null | undefinedDate of highlighted day |
className | — | stringClass names to add to wrapper component |
numberOfMonths | 1 | 1 | 2The number of months to display. |
todayText | "Today" | stringThe text to display for the today date. |
Dynamic value type
Type of value and onChange callback depends on the selected calendar mode.
type CalendarDateValue = Date | null | undefined| Mode | Value type |
|---|---|
| date | CalendarDateValue |
| range | [CalendarDateValue, CalendarDateValue] |
Last updated on