hello @all
please help me to find the solution as i want to disable the dates that are before current date.
Thnaks!
You could use minDate and pass in todays date to disable all dates before todays date. You could also use tileDisabled.
<Calendar
minDate={new Date()}
/>
Or
private tileDisabled = ({date }: CalendarTileProperties & {activeStartDate: Date}) =>
{
if(date.valueOf() < todaysDate.valueOf()) {
return true;
}
return false;
}
<Calendar tileDisabled={this.tileDisabled} />
In general, minDate is the best to disable all dates before a certain date. tileDisabled is best when you want to disable select dates. So in this case, minDate is the way.
thanks @Herting @wojtekmaj
Most helpful comment
You could use minDate and pass in todays date to disable all dates before todays date. You could also use tileDisabled.
<Calendar minDate={new Date()} />Or