3
votes

I need to build a simple calendar to embed in my PHP application.

Basically I have a bunch of recurrent events whose iCal recurrent rule (rrule) is known (e.g.: "FREQ=MONTHLY;INTERVAL=2;BYDAY=SU" or "FREQ=WEEKLY;BYDAY=SU").

Basically I need a function that given
_ an event iCal rrule
_ a certain day (e.g. 04/10/2011)
returns a boolean telling me whether the event is on at that date.

Obviously I can build it myself but it would take ages: is there any reliable library already available for that?

Thanks,
Dan

1
9 years later and I am wondering if you have found what you were looking for? I'm looking for the same function (for another language but well, one cannot be to picky about that). - goldensoju

1 Answers

2
votes

Although I am at the end of my own calendar project and I am not using iCal, perhaps this will help.

My own experience is that I could not find any sort of library and I coded my own backend from scratch.

For the front-end, I would urge you to use FullCalendar, it is an amazing calendar with what you can do with it. All you need to then, is concentrate on the backend.

For the db, I would go the route of having only 1 database row per event and when that event is modified, if it is recurring then you amend the existing event and create a new event with the change.

For the back-end logic, in conjunction with fullcalendar it gives you a window to work with. Within this window, I would then work out when the event occurs and then show, if the event is recurring to then work out when it should be shown on the calendar. It can get a bit complex but you can do it.

I'm attaching pics of what I have done, sadly this project isn't open source.

Add New Recurring Event

Calendar with Recurring Events

Amend Recurring Event

Agenda List View

Cheers