J
J
justjeckill19932018-08-11 15:41:29
JavaScript
justjeckill1993, 2018-08-11 15:41:29

How to get the day of the week when entering a date?

You need to create a function that, when you enter a date, will show what day of the week it was. Time period August 7 - September 8. The calendar is not ours. you have to generate it yourself.
I tried to do it through the generation of an associative array, but I run into the problem of how to avoid the program stupor when moving to the next month (September, for example), if the transition occurs in the middle of the week.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2018-08-11
@justjeckill1993

Why bother with associative arrays when ES6 has a standard method
date.toLocaleString('ru', {weekday: 'long'})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question