react-multi-date-picker
react-multi-date-picker copied to clipboard
how to disable past days
i want to disable past days in calendar
here is my current approach
mapDays={({ date, isSameDate, today }) => {
let isBooked = bookedDays.find((x) => isSameDate(date, x));
if (
date.year <= today.year &&
date.month.index <= today.month.index &&
date.day < today.day
) {
return {
disabled: true,
style: { color: "#ccc" },
};
}
}}
is there a more optimized way?