I am using jQuery UI Datepicker for users to select their date of birth (DOB). My codes are as follows: -
$('#DOB').datepicker({ changeMonth: true, changeYear: true, maxDate: new Date(), yearRange: '-100:+0' });
However, today I noticed that from January of this year he did not show the rest of the months (from February to December), unless I changed the year to the previous year. I made a workaround by adding another option
showMonthAfterYear: true
This is not an ideal solution as its βpushingβ users to select the year before the choice of months. Another solution was to change the settings as shown below.
yearRange: '-100:-1'
The above 2 workarounds may help others, but I hope for a permanent solution, if any. Thanks again.
source share