I’m trying to create a yearly automated schedule for a publication. Every issue has 3 dates (Wednesday, Friday & Monday), that occur every two weeks. And in some cases when the day falls on a holiday it should automatically adjust and goto the following day.
I’m trying to do this all right now in PHP, I’ve got most of it working but after issue 7 the script goes wrong and seems to skip a week. Can anyone help or suggest a way of achieving this?
Here is pseudo-code of my logic;
For 12 months
Get the amount of days in a given month
For days in a month
If Wednesday
assign date to a var
Else if Friday
assign date to a var
print wednesday var
print friday var
print monday var
increment counter in order to skip ahead to the next week
Else if Monday
assign date to a var
Thanks
I think this should point you in the right direction (untested, but should do what you want).