Skip to content
Advertisement

DateTime: get next monday OR wednesday

Let’s say I have a date and want to get the next monday OR wednesday, which was more closer from the date.

JavaScript

Is possible to set two or more weekdays?

Advertisement

Answer

No, but you can work around the issue:

JavaScript

So the next day is next wednesday only if format(‘w’) is 1 or 2.

Therefore,

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement