Disabled Dates
The Calendar allows you to disable the selection of specified dates by providing a disabledDates
value to the component.
The Calendar supports the following approaches for disabling dates:
- Using a function—The format for this input is
(date: Date) => boolean
. The approach disables each date for which the provided function returnstrue
. - Using an array of dates—The format for this input is
Date[]
. The approach disables only the dates that are explicitly listed. - Using an array of days—The format for this input is
Day[]
. The approach disables the specified days of the week.
Using a Function
The following example demonstrates how to provide a function to disable every even date in the Calendar.
Using a Date Array
The following example demonstrates how to provide an array of dates to disable the listed dates.
Using a Day Array
The following example demonstrates how to provide an array of Day
enum values to disable the listed days of the week, that is, the days of the weekend.