I have a datepicker with changeyear: true. The \'year\' drop down displays the title as 2009, then instead of the next year below the title being 2008, 2007, 2006 and so on
Replace the first line of the for loop with:
for
var minYear = year; year = endYear; for (; year >= minYear; year--) {