I'm trying to create a very simple script which will tell you the number of days to the next Friday. However, the next Friday is set on a 4 week repeating pattern starting from Friday 17 July.
For example, the script could be to track menstrual cycles (it's not, but you get the idea!). An event that happens every 4 weeks, not every month, starting from a specified date.
The script is fairly simple, but I'd appreciate some feedback on the best way to set it up. The options as I see them are:
1] Add 4 weeks to the original date
Add 4 weeks to the original date until the date is in the future, then count the no of days
2] Store the next date somewhere, and if the date is today or in the past, advance it by 4 weeks
Is there another option I'm missing? The only reason I hesitate before using option 1 is that the execution time will increase every 4 weeks. So if the script were to run for say 100 years, it would need 13'000 iterations of the loop!
I'm probably being overly anal here, so any feedback welcome!
Thanks in advance,
CM.