Skip to content

Instantly share code, notes, and snippets.

@sanzhardanybayev
Last active August 8, 2018 10:56
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 sanzhardanybayev/9f9f7e19f1582128bc5f79f7caad23a9 to your computer and use it in GitHub Desktop.
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
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'
}
@sanzhardanybayev
Copy link
Author

Save your time and thank me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment