Skip to content

Instantly share code, notes, and snippets.

@vortizhe
Created May 19, 2013 09:35
Show Gist options
  • Save vortizhe/5607201 to your computer and use it in GitHub Desktop.
Save vortizhe/5607201 to your computer and use it in GitHub Desktop.
Simple localización de fecha
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