I am working on a scheduler. I hit a wall with the weekly option. The option is to have an event be scheduled for however many weeks on specific checked days. I have the code for adding the weeks, but I can't figure out how to get the start date right.
For instance, if the user wants to schedule an event every monday and today is a thursday, how do I count how many days it is from thursday to monday to get the start date if date resets the day number (w) on sunday to 0? The long way of doing this is to do a series of if statements assigning a number to add to today's date. But that's 49 if statements and I'm sure there's a better way, I just can't seem to grasp it.
Thanks in advance