react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

showYearDropdown is not working with monthYearPicker

Open Donorlin opened this issue 3 years ago • 2 comments

Describe the bug Property showYearDropdown is not working when datepicker is in the monthYearPicker mode

To Reproduce

() => {
  const [startDate, setStartDate] = useState(new Date());
  return (
    <DatePicker
      selected={startDate}
      onChange={(date) => setStartDate(date)}
      showMonthYearPicker
      showYearDropdown
    />
  );
};

Expected behavior I would expect a year dropdown in month year picker header as in https://reactdatepicker.com/#example-year-dropdown

Versions: react-datepicker 4.6.0 react: 16.14.0 react-dom: 16.14.0

Donorlin avatar Jan 23 '22 23:01 Donorlin

i am also expecting this feature. let's see..

sathishkumarssk avatar Jul 27 '22 05:07 sathishkumarssk

monthYearPicker also does not work with customHeader 🙁

kamnakis avatar Sep 09 '22 06:09 kamnakis

Yep same problem here regarding the showYearDropdown option.

@kamnakis I'm able to use renderCustomHeader, I tested it with the docs example without issue.

Dahmon avatar May 22 '23 22:05 Dahmon