Hey guys,
Does anyone have, already made, some type of "recurring events"
module? We have our in-house function that works with singular weekly
and singular monthly events but we'd like to branch into daily,
bi-daily, bi-weekly, bi-monthly, every X weeks, every X days, etc.
Our current logic for calculating "the next event" for a weekly event is
thus:
Take the original time stamp of the event. Compare that to current
time. If eventTimeStamp is greater than current time, return that
date/time. Otherwise, add 1 week to eventTimeStamp and compare again.
Loop until eventTimeStamp is greater than current time.
To me, this seems amazingly inefficient. If my weekly recurring
original event start date was Aug 1, 2006, the perl would have to loop
26 times to find the next event (in this case, Jan 23).
Can anyone offer a better solution to this?
Thanks,
Matthew