Created
December 13, 2013 09:13
-
-
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());
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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