Last active
September 4, 2023 20:07
-
-
Save 4drian-sanchez/67c67e2d4bc402354344b78ba3c74d18 to your computer and use it in GitHub Desktop.
date formatter
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
export const dateFormatter = fecha => { | |
const nuevaFecha = new Date(fecha.split("T")[0].split("-")); | |
const opciones = { | |
weekday: "long", | |
year: "numeric", | |
month: "long", | |
day: "2-digit", | |
}; | |
return nuevaFecha.toLocaleDateString("es-ES", opciones); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment