Reputation: 2372
I am using bootstrap datepicker and when I open the dropdown to change the year, it shows only 20 years... The current year.. 10 years before and 10 after.
How can I change it and make it show 40 years.. ? the current year ,20 before and 10 after?
Is that posible?
This is what I have setted
$(".datepicker").datepicker({
changeMonth: true,
changeYear: true,
});
$(".datepicker").datepicker("option", "showAnim", "clip");
This is the format I have
Upvotes: 0
Views: 47
Reputation: 44
I think you need to set the startDate and endDate properties with this kind of syntax
$(".datepicker").datepicker({
changeMonth: true,
changeYear: true,
startDate: '-20y',
endDate: '+20y',
});
Upvotes: 0
Reputation: 1601
$(".datepicker").datepicker({
changeMonth: true,
changeYear: true,
yearRange: "-20:+10" // 20 years before and 10 years after the current year
});
$(".datepicker").datepicker("option", "showAnim", "clip");
you can use the yearRange
Upvotes: 1