Answer the question
In order to leave comments, you need to log in
How to get specific days of the week in a date period?
Good day everyone.
Prompt how to implement on more compactly.
I need in the period for example from 07/11/2016 to 07/31/2016 to select the dates of all, for example, Mondays.
The result for example will be 11-07-2016, 18-07-2016, 25-07-2016.
Answer the question
In order to leave comments, you need to log in
If the selection condition is dynamic, then just go through all the dates from the range and check for a specific condition.
If Mondays, then we find the first Monday from the range, push the date in a week until we leave the range.
Use the Datetime class's format() method to view specific date parameters.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question