Last active
January 4, 2016 20:00
-
-
Save knu2xs/8671524 to your computer and use it in GitHub Desktop.
Modify date prototype to include a method to return the date the way I like it.
This file contains 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.toMilitaryString = function () { | |
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; | |
return this.getDate() + ' ' + months[this.getMonth()] + ' ' + this.getFullYear(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment