Last active
March 10, 2021 13:40
-
-
Save parzibyte/696ea8e4b57c12c37f1b49dd0abdb358 to your computer and use it in GitHub Desktop.
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
const nombreDelDiaSegunFecha = fecha => [ | |
'domingo', | |
'lunes', | |
'martes', | |
'miércoles', | |
'jueves', | |
'viernes', | |
'sábado', | |
][new Date(fecha).getDay()]; | |
const fechasParaProbar = [ | |
"2013-01-18 17:00:00", | |
"2013-08-03 10:00:00", | |
"1997-06-21 22:00:00", | |
]; | |
fechasParaProbar.forEach(fecha => { | |
console.log(`En ${fecha} fue ${nombreDelDiaSegunFecha(fecha)}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment