I am using this date picker component: https://react-day-picker.js.org/examples/disabled
In the below disabledDays section. I am unable to apply all three options. blockedDatesData is working alone but it is not working with daysOfWeek and before.
<DayPicker
className={className}
numberOfMonths={numberOfMonths}
selectedDays={[from, { from, to }]}
modifiers={ {
weekends: {daysOfWeek: [0, 6]},
start: new Date(from), end: new Date(to)
}}
onDayClick={handleDayClick}
disabledDays={
{ daysOfWeek: [0, 6] },
{ before: disabledBefore},
blockedDatesData
}
/>
Here are the codes that are generating blockedDatesData json object.
getBlockedDatesData(){
let url = API_URL+'blocked_dates'
return fetch(url)
.then(response => response.json())
.then(result => {
let blockedDatesData = result.data.map(function(row) {
return {
after: new Date(row.date_from),
before: new Date(row.date_to)
};
});
return blockedDatesData;
})
}
Please help me to fix this issue. thanks in advance