Open parvesh2810 opened 1 month ago
Hi, parvesh2810. I don't think it is a good idea to activate the year 2023 in the year selection dropdown in the above state. It is not correct to make selected date to prior to minDate (a date that cannot be selected), so you need to re-select 2024 or later in the year selection dropdown. (I have a feeling the current behavior is correct)
Sorry if this is not what you intended.
Describe the bug Wrong year is shown in year select dropdown if past date is selected with minDate={new Date()}
Sample Code
() => { const [startDate, setStartDate] = useState('10/18/2023'); return ( <DatePicker showMonthDropdown showYearDropdown dropdownMode='select' minDate={new Date()} selected={startDate} onChange={(date) => setStartDate(date)} /> ); };
Screenshot
Macbook Air M1 Brave Browser