-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Using showMonthYearPicker
, the minDate
and maxDate
props gray out the correct months as long as they're in the same year. But if your maxDate is in the next year (2020 for this example), only the top row of months (Jan - Mar) gray out even if your minDate is after April. maxDate
correctly grays out the months that follow.
Example component:
<ReactDatePicker dateFormat='MMM-yyyy' selected={new Date('06-04-2019')} minDate={new Date('06-01-2019')} maxDate={new Date('03-01-2020')} showMonthYearPicker />
Expected behavior
This should gray out the months Jan - May 2019
Actual behavior
Even though the minDate is June, months April and May look selectable, but are not, and do not have the class react-datepicker__month--disabled
I have a PR I'll open shortly for this issue and link back