In react-datepicker
, the year dropdown is not shown, all attributes are passed. But the year dropdown is still missing.
<DatePicker name={props.inputName} id={props.dateBoxId} placeholderText={props.placeholderText} autoComplete="off" dateFormat={props.dateFormat} selected={props.value} onChange={(e) => props.changeSelection(e, props.inputName)} timeInputLabel="Time:" disabled={props.disabled !== undefined ? props.disabled : false} showTimeInput={props.showTimeInput} minDate={subDays(new Date(), props.minDate)} maxDate={addDays(new Date(), props.maxDate)} onKeyDown={(e) => { e.preventDefault(); }} showMonthDropdown showYearDropdown yearDropdownItemNumber={15} scrollableYearDropdown />;
Try increasing the
yearDropdownItemNumber
value to 50. The possible reason is that it selects the minimum and maximum dates of the current year, and in the year dropdown, it shows 1997, while your currentyearDropdownItemNumber
value is only 15.