jQuery UI: Datepicker set year range dropdown to 100 years
Solution 1:
You can set the year range using this option per documentation here http://api.jqueryui.com/datepicker/#option-yearRange
yearRange: '1950:2013', // specifying a hard coded year range
or this way
yearRange: "-100:+0", // last hundred years
From the Docs
Default: "c-10:c+10"
The range of years displayed in the year drop-down: either relative to today's year ("-nn:+nn"), relative to the currently selected year ("c-nn:c+nn"), absolute ("nnnn:nnnn"), or combinations of these formats ("nnnn:-nn"). Note that this option only affects what appears in the drop-down, to restrict which dates may be selected use the minDate and/or maxDate options.
Solution 2:
Try the following:-
ChangeYear:- When set to true, indicates that the cells of the previous or next month indicated in the calendar of the current month can be selected. This option is used with options.showOtherMonths set to true.
YearRange:- Specifies the range of years in the year dropdown. (Default value: “-10:+10″)
Example:-
$(document).ready(function() {
$("#date").datepicker({
changeYear:true,
yearRange: "2005:2015"
});
});
See:- set year range in jquery datepicker
Solution 3:
I did this:
var dateToday = new Date();
var yrRange = dateToday.getFullYear() + ":" + (dateToday.getFullYear() + 50);
and then
yearRange : yrRange
where 50
is the range from current year.
Solution 4:
You can set the year range using this option in jQuery UI datepicker:
yearRange: "c-100:c+0", // last hundred years and current years
yearRange: "c-100:c+100", // last hundred years and future hundred years
yearRange: "c-10:c+10", // last ten years and future ten years