Topic: Parse date from wday
I am saving a record with a day_number attribute. I would like to retrieve the earliest date in future with a wday value equal to the day_number.
I have a record with day_number = 3
I now want to retrieve the next date with wday = 3 (so the next Wednesday) is. If today is Wednesday it should return todays date, else next week Wednesday's date.
Any idea how I can accomplish this?