Call the function passing a starting Year and it will return an array containing all years from the starting year to the current
//
//build a list of years
function getYearsList(fromYear) {
var arrYears = [];
var oDate = new Date();
//add next year in the list if in two months
if (oDate.getMonth() >= 10) { arrYears.push({ val: oDate.getFullYear() + 1, label: oDate.getFullYear() + 1 }); }
var currYear = oDate.getFullYear();
for (y = currYear; y >= fromYear; y--) {
arrYears.push({ val: y, label: y });
}
return arrYears;
}