Adding different class names to disabled days in Matcher array #2490
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Just to update on my current solution is someone will find it useful. Currently I am using this CSS selector to match all disabled dates that are in the future.
|
Beta Was this translation helpful? Give feedback.
-
@PrimozRome not sure I understand your case here - anyway, you can use the For example, const disabled = [
{
before: new Date(),
},
{
after: new Date(2024, 9, 13),
before: new Date(2024, 9, 19)
}
];
<DayPicker
mode="range"
numberOfMonths={2}
startMonth={new Date()}
disabled={disabled}
modifiers={{
// Add a modifiers to disabled days.
myModifier: disabled
}}
modifiersClassNames={{
// Add a custom class name to disabled days.
myModifier: 'your_custom_class_name'
}}
/> See https://daypicker.dev/guides/custom-modifiers Would that work for you? |
Beta Was this translation helpful? Give feedback.
@PrimozRome than the
modifiers
prop is what you are looking for:Then in your CSS: