Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active April 13, 2018 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/27d0e2f24d1bb190bb6dfc716f04d8c2 to your computer and use it in GitHub Desktop.
Save parzibyte/27d0e2f24d1bb190bb6dfc716f04d8c2 to your computer and use it in GitHub Desktop.
angular
.module("tuApp")
.filter("fechaCorta", function () {
return function (fecha) {
if (!fecha) return "";
fecha = new Date(fecha);
return (fecha.getDate() > 9 ? fecha.getDate() : "0" + fecha.getDate()) + "/" + (["ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic"][fecha.getMonth()]) + "/" + fecha.getFullYear()
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment