react js Date-picker(react js date-picker set year range in year drop down list )
react js Date-picker(react js date-picker set year range in year drop down list )
how to disable the past years in year drop down list in react date picker?
the problem is when we click the drop down list it shows past years as well as future year.I want show the current and future years enter image description here
The code did not disable the years in year drop down but it disable the dates
– Abishek
Jun 29 at 17:33
1 Answer
1
You can pass the prop minDate
to the DatePicker
component, and set it to the start of the current year.
minDate
DatePicker
<DatePicker
minDate={moment().startOf('year')}
/>;
Will this disable previous dates or just set the start date?
– Sterling Archer
Jun 29 at 17:22
It does not works for year drop down list
– Abishek
yesterday
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
This may be relevant stackoverflow.com/questions/41323221/…
– Sterling Archer
Jun 29 at 17:23