Last active
August 8, 2018 10:56
-
-
Save sanzhardanybayev/9f9f7e19f1582128bc5f79f7caad23a9 to your computer and use it in GitHub Desktop.
Simple date function that can be used anywhere. For now it has only Russian Language 👅 If you wish more, feel free to make push requests
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 days = [ | |
'Воскресенье','Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота' | |
] | |
const getDayName = (date) => { | |
if(date) | |
if(typeof date === 'number') | |
return days[new Date(date).getDay()] | |
else if (typeof date === 'object') | |
return days[date.getDay()] | |
else | |
return 'You must provide date parameter' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Save your time and thank me)