Retrieve the last day of the year in javascript
alert(new Date(2012, 12, 0));
will return
Mon Dec 31 00:00:00 CST 20102
In case that someday the last day of the year changes, could be useful to use a temporary date with the first day on the next month and then return to the previous date
tmp_date = new Date(2012, 12, 1)
last_day = new Date(tmp_date - 1)
Since the last day of a year is always December 31, it's easy:
new Date(new Date().getFullYear(), 11, 31)