buildDisabledPredicate

Calendar
stable

Factory that normalises the disabledDates prop (array of Date | string, or a custom predicate) into a single (date: Date) => boolean function consumed by calendar cell builders.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

input
requis
Array<Date | string> | ((d: Date) => boolean) | undefined
Disabled dates as an array of Date / ISO string values, a custom predicate function, or undefined. When undefined, the returned predicate always returns false.

API

Valeur de retour

La valeur retournée par cet util.

A single predicate that returns true for any date that should be disabled in the calendar.

Usage

Exemples

Extraits de code prêts à coller.

Disable specific dates from an array

typescript

Pass a custom predicate directly

typescript