Closed geraldo-thorpe-innovation closed 4 years ago
This code resolve my problem:
in this part, we take all the dates prior to the current day, and we add there is a state:
let date = new Date()
const test = date.setDate(new Date().getDate() - 1)
setPriorDates(test)
<CalendarPicker
...
disabledDates={[priorDates]}
disabledDates
also accepts a function. You could use it like this to disable dates before today:
const today = moment();
<CalendarPicker
disabledDates={date => date.isBefore(today, "day")}
//...
/>
Is there any way to disable previous dates, compared to my current date? At the moment, I cannot allow my user to select dates from the past.