Reputation: 675
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"
});
});
Upvotes: 4
Views: 5551
Reputation: 2291
This works for me;
$("#txt_birthdate").datepicker({
yearRange: "-100:-18",
changeMonth: true,
changeYear: true,
maxDate: new Date()
});
Upvotes: 5
Reputation: 8482
You can use yearRange
option for that;
$('#datepicker').datepicker({
changeMonth: true,
changeYear: true,
yearRange: "-65y:-18y"
});
Upvotes: 6