I would expect the following would have the date range to start from 65 years ago and end at 18 years ago. Instead, minDate number is ignored, and set to 10 years prior to end date. No difference whatever I put as value in minDate.
$(function() {
$("#datepicker").datepicker({
changeMonth: true,
changeYear: true,
minDate: "-65y",
maxDate: "-18y"
});
});
You can use yearRange
option for that;
$('#datepicker').datepicker({
changeMonth: true,
changeYear: true,
yearRange: "-65y:-18y"
});
This works for me;
$("#txt_birthdate").datepicker({
yearRange: "-100:-18",
changeMonth: true,
changeYear: true,
maxDate: new Date()
});
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