Created
May 19, 2013 09:35
-
-
Save vortizhe/5607201 to your computer and use it in GitHub Desktop.
Simple localización de fecha
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
String.prototype.datify = function() { | |
var months = "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"), | |
// Date string to parse: 2012-02-16 22:02:30 GMT | |
date_string = this.split(' ')[0], | |
date_reverse = date_string.split('-').reverse(); | |
date_reverse[1] = months[date_reverse[1] -1]; | |
return date_reverse.join(' '); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment