javascript date of last day of previous month var LastDayPrevMonth = new Date(Year, Month, 0).getDate();