I'm using jquery ui datepicker with changeYear. The problem is that it shows the years in chunks (from 1985 to 2005, then clicking on 1985 opens other years) I need to show ALL the years in the range I'm passing like this:
$(".datepickerBDAY_trigger").datepicker({
"dateFormat": "yy-mm-dd",
changeMonth: true,
changeYear: true,
maxDate: "-16Y",
minDate: "-100Y"
});
How can I do this? I cannot find this information anywhere else.
Thanks
You can use the yearRange option. Its first form (-nn:+nn
) allows you to specify a range relative to the current year instead of the currently selected year.
$(".datepickerBDAY_trigger").datepicker({
dateFormat: "yy-mm-dd",
changeMonth: true,
changeYear: true,
maxDate: "-16Y",
minDate: "-100Y",
yearRange: "-100:-16"
});
You can see the results in this fiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With