//Month is 1 based
function daysInMonth(month,year) {
return new Date(year, month, 0).getDate();
}
//July
daysInMonth(7,2009); //31
//February
daysInMonth(2,2009); //28
daysInMonth(2,2008); //29
Ref : http://stackoverflow.com/questions/1184334/get-number-days-in-a-specified-month-using-javascript
Comments
Post a Comment