I am using date picker of jquery .As i use default it show year 2003 to 2023 only 20 values . I need to increase this value . when i use this code
$( "#inputBirthDate" ).datepicker({
changeMonth: true,
changeYear: true,
});
it show 20 values .. BUt when I used this it is not showing, it show 2030 to 2050
$( "#inputBirthDate" ).datepicker({
changeMonth: true,
changeYear: true,
minDate: new Date(1990-01-01),
maxDate: new Date(2050-01-01),
inline: true
});
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
Actually your first piece of code is working correct. This is the default behavior of datepicker, check this demo and code.
min: current year -10 (2013 - 10 = 2003)
max: current year +10 (2013 + 10 = 2023)
However this can be cahanged using the following option.
yearRange: "-20:+0"
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