Created
October 29, 2019 20:01
-
-
Save romaefGit/2a127c37a85de30203e08a454369429e to your computer and use it in GitHub Desktop.
JavaScript - desbarata fecha
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
| /** | |
| * Autor - Romario Estrada - romarioestrada.ff@hotmail.com | |
| * [desbarataFecha recibe fecha en formato mes / dia / año -> 3/12/2017] | |
| * @param {[String]} fecha [fecha] | |
| * @return {[JSON]} [fecha partida en un JSON] | |
| */ | |
| var desbarataFecha = function(fecha) { | |
| var respuesta = { day: null, month: null, year: null }; | |
| arrayFecha = fecha.split("/"); | |
| respuesta.day = parseInt(arrayFecha[1]); | |
| respuesta.month = parseInt(arrayFecha[0]); | |
| respuesta.year = parseInt(arrayFecha[2]); | |
| return respuesta; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment