I'm using jquery's datepicker for users to select their DOB. I set the default to 01/01/1980 so that its a little easier to select your DOB (our constraint is that your age > 18 years.
I set minDate to be 100 years in the past from today. When I toggle the datepicker, the minimum date appears to be 1970. If I select it, close the datepicker, and open it again, I can go further back (to select 1960 for example). I would like to allow users to select a date preceding 1970 without having to do this.
Code:
$(function() {
$( "#id_date_of_birth" ).datepicker({
changeMonth: true,
changeYear: true,
maxDate: "-18Y",
minDate: "-100Y",
defaultDate: '01/01/1980'
});
});
It looks like the range cap happens to be about an 18 year split.
That might be related to your
maxDate
Try omitting the
maxDate
or increasing it to see if you're still capped at 1970 on the first opening of the dropdown.If that works, you can play with your
defaultDate
andmaxDate
to get the desired range.From the Docs:
http://api.jqueryui.com/datepicker/#option-maxDate