Skip to content

Instantly share code, notes, and snippets.

@ttepasse
Created October 30, 2009 01:04
Show Gist options
  • Save ttepasse/221995 to your computer and use it in GitHub Desktop.
Save ttepasse/221995 to your computer and use it in GitHub Desktop.
function daysInMonthOf(theDate) {
var nextBegin = new Date(theDate.getYear, theDate.getMonth + 1, 1),
lastDayOfMonth = new Date(nextBegin.getTime() - 1);
return lastDayOfMonth.getDate();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment