Working With Recurring Events In Yii

Hi guys,

I’m quite new to Yii, but I really like it. However, I’m wondering how to achieve the following task:

I have a event database, with events that can be scheduled. So, each event can recur in an fixed intervall (each year, each quarter, each month, each week, etc…). It doesn’t need to be very flexible (“Recur only on tuesdays, when there is half moon” is not needed).

However, I’m wondering how to display these events on a monthly base. If an event got created on 2013-04-15, and should recur weekly, if I look at May 2013, it should be displayed for 2013-05-06, 2013-05-13, 2013-05-20 and 2013-05-27.

How could I achieve this? Our should I save the corresponding entries for the next 12 month in the database and do a recalc after the months have passed?

Any help is appreciated. :)

For better performance and better control create individual occurrence of event in DB table

table : recurring_event

table : event