I have the following function which is called in a MVC struts application’s jsps. It’s a generic jQuery-UI datepicker set up.
function setUpGenericDate(id) {
var d=new Date();
$("#" + id).datepicker({
duration: 'fast',
showAnim: 'drop',
dateFormat: "dd/mm/yy",
maxDate: '0',
showOn: 'button',
buttonImage: '/img/calendar.gif',
buttonImageOnly: true,
yearRange: '1900:'+d.getFullYear(),
changeMonth: true,
changeYear: true
});
}
I called that function on the onLoad body event like this:
<body style="margin-top:10px; margin-left:20px;"
onLoad="setupJQuery();setUpsetUpGenericDate('meetingDate');jButton('btnCancel');jButton('btnUpdate');">
Above, “meetingDate” is an id for an input text object in a form.
The problem is when visualizing the datepicker year menu for changing it, it doesn’t visualize the while year. for example 2010 to 2012 shows only 201 and for 2000 to 2009 shows 200 only.
When the user chooses a date, it shows the whole year complete (‘yyyy’) on the input text. The problem only occurs while selecting a year in the menu. What could it be?
Thanks in advise

I’ve created the fiddle for you:
http://jsfiddle.net/MhxMz/
As you can see, your code is perfectly fine.
The error is somewhere else…
I can suggest you to do
alert(d.getFullYear());just afterDate d = new Date();, to check that javascript Date is working fine…Check your libraries too, avoid duplicates and conflicting versions.