I have an array of events in which we have objects containing the start and end date of the event.
[
{
"start": "2020-10-07T15:30:00+05:00",
"end": "2020-10-07T16:30:00+05:00"
},
{
"start": "2020-10-11T16:00:00+05:00",
"end": "2020-10-11T20:00:00+05:00"
}
]
I want to disable the range in which an event is occurring in the react-datepicker. So that user cannot select the date or time on which an event is already booked.
You can exclude dates and/or times using these two props:
excludeDatesandexcludeTimes.Documentation here presents how to do it under "Exclude dates" and "Exclude times" sections. https://reactdatepicker.com/