Calendar options
useCalendar hook gets an object of type CalendarOptions - this allows you to set your desired configuration and behavior. Each of the options has its default (see below) and you can call the hook without the options object.
useCalendar({
startMonth: 1, // January
startYear: 2024,
numberOfDisplayedMonths: 1,
isRangePicker: false,
minDate: undefined,
maxDate: undefined,
allowFuture: true,
allowPast: true,
locale: 'en'
});startMonthThe month to start from
number
today's month
startYearThe year to start from
number
today's year
numberOfDisplayedMonthsNumber of months that are displayed to the user to select from
number
1
isRangePickerWether the calendar instance is a range picker, allowing the user to select 2 dates representing a range
boolean
false
minDateThe minimal date that can be selected by the user
Date
undefined
maxDateThe maximum date that can be selected by the user
Date
undefined
allowFutureShould the user be allowed to choose future dates.
boolean
true
allowPastShould the user be allowed to choose past dates.
boolean
true
localeThe locale to be used
string
en
Last updated