function LastDayOfMonth(Year, Month) { return(new Date((new Date(Month+1 +"/"+ 1+"/"+ Year ))-1)).getDate(); }
function getLastMonth(year, month) { lastDateofTheMonth = new Date(year, month, 0) alert(lastDateofTheMonth); }
function getDaysInMonth(aDate){ // returns the last day of a given month var m = new Number(aDate.getMonth()); var y = new Number(aDate.getYear()); var tmpDate = new Date(y, m, 28); var checkMonth = tmpDate.getMonth(); var lastDay = 27; while(lastDay <= 31){ temp = tmpDate.setDate(lastDay + 1); if(checkMonth != tmpDate.getMonth()) break; lastDay++ } return lastDay; }
function getLastMonth(year, month) { lastDateofTheMonth = new Date(year, month +1, -1) alert(lastDateofTheMonth); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)