Skip to content

Instantly share code, notes, and snippets.

@MNBuyskih
Created December 13, 2013 09:13
Show Gist options
  • Save MNBuyskih/7941748 to your computer and use it in GitHub Desktop.
Save MNBuyskih/7941748 to your computer and use it in GitHub Desktop.
Method allow get totals days in month. Usage: var date = new Date(2013, 2, 14); alert(date.getDaysInMonth());
Date.prototype.getDaysInMonth = function () {
return (new Date(this.getFullYear(), this.getMonth() + 1, 0)).getDate();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment