views:

285

answers:

1

Hello, Gurus!

I'm in middle of creating calendar app. for iPhone. I get calendar events from google calendars (without expanding recurrence) Then tried to expand recurrence events by writing codes from scratch. I did get iCalendar format from the web, for example the following one:

http://www.kanzaki.com/docs/ical/rrule.html

but expanding recurrence events from scratch looks like bad idea too complicated that error prone.

So, does anyone know where to find algorithm for "expanding recurrence events"?

prefers objective-c but Java and the languages alike is OK. (I tried to look at Sunbird but couldn't analyze well)

Please advise!

Katsumi

+1  A: 

Any reason why you don't ask Google Calendar to expand it for you? Admittedly that means more data, but at least then you'll know you've got the same results as Google Calendar.

You can use ical4j but I've personally had some implementation issues with it, particularly in terms of it using the system default time zone.

(In general, my advice would be to avoid writing a calendar app at all - calendaring is nightmarishly complicated. Any reason for writing a replacement for the iPhone's calendar? "Wanting to learn about calendaring" is a perfectly valid reason, although you're basically embracing insanity at that point.)

Jon Skeet
Thank you for your comment Jon!Well, the reason for dealing with expanding recurrent event on iPhone side is that the app. need to support local creation of recurrence event.In addition it needs to support for off-line calendar functions.Two requirements together make the troublesome local expansion of recurrence events...I see some iPhone calendar apps supporting this functionality, I wonder how those apps' creators did.Katsumi
Katsumi
@Katsumi: That's fair enough. It could be that there are libraries which support this which you can use from Objective-C, but that's far beyond my realm of expertise. All I know is that it's a fiendishly complicated area :(
Jon Skeet
+1 for "embracing insanity" :)
Matt Gibson