I
I
Ivan Simonov2018-09-19 17:16:02
JavaScript
Ivan Simonov, 2018-09-19 17:16:02

How to correctly display the correct date?

I'm trying to display Sunday by date
For example,
September 16 September
23 September
30

It turns out that if September 16 has come, the date should change to September 23, etc.

Now the countdown is from today plus 7 days
My code is Fiddle

Tell me how to write the condition correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey, 2018-09-19
@ivansimonov1984

https://jsfiddle.net/jkg2wnh4/17/

date.setDate(date.getDate() + (7 - date.getDay()));

A
Alexander Shpak, 2015-04-18
@reskwer

Just like before. Hold LMB on the button for changing the position and select the desired mode. Chrome 42 under Windows.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question