If someone held a gun to your head and demanded in the next week you either 1) programmed a comprehensive system that included full support for recurring events, or 2) invent full-scale ready-to-go-to-market cold fusion, then you should abolutely start brushing up on atomic physics. Recurring events is a true shit show.
It starts normally enough, of course. You have an innocent phrase that you want to apply to your system, like:
"Every Tuesday at 2pm"
Awesome. So you start modeling it in your database. You say, hey, I’ll just create an event with a
... read the whole story at zachholman.com.
starts_at value of next Tuesday. And then you save another row for the Tuesday after that. And then another row for the Tuesday after that. And after that. And after that. You do this for 70 occurrences before you start realizing, hey, I think this goes to infinity. (Don’t ask me why it took you that long to figure this out; you’re the one who’s a little slow on the update. I figured it out by the 52nd occurrence.)