I’m using the jQuery date picker widget and it works nicely but I’m confused as to how to set the initial year, in the drop down.
Here’s my code:
$(function() {
$( "#datepicker" ).datepicker();
$.datepicker.setDefaults( {changeYear: true , yearRange: '1900:1998',gotoCurrent: true});
});
This produces the correct calendar, but sets the initial year as 1900. I don’t want the user to have to scroll through a hundred years of options and would like to have the year that pops up default to 1998. Is this simply not possible? Or am I overlooking a setting in the doc?
lol, “you’re doing it wrong” 😛
You dont need
.setDefaultsFor more information on default date format see here
see Scott‘s jsFiddle with working Css 😛
I would suggest doing it more like this: