JS gets the code for the number of days of the month according to the year


function getDaysInMonth(year,month){
month = parseInt(month,10); //ParseInt (number,type) defaults to base 10 if it is not followed by a second argument.
var temp = new Date(year,month,0);
return temp.getDate();
}