Internet calendar formats revisited

by Brian Enigma on July 5, 2010 10:43am

in Code

A few weeks ago, I was com­plain­ing about the lack of a good Open Source library for both pars­ing AND mak­ing use of the vcal/ical inter­net cal­en­dar feed for­mat.  Quite a few solu­tions exist for sim­ple pars­ing but few (okay, zero that I could find) solid, robust solu­tions exist for doing any­thing intel­li­gi­ble with the data once parsed — specif­i­cally, expand­ing out the var­i­ous types of recur­rences and can­cel­ing out occur­rence exceptions.

Last week, a poten­tial solu­tion just dropped right into my lap.  For some rea­son that I do not remem­ber I was look­ing at Dash­code, Apple’s tool for writ­ing and debug­ging JavaScript-based wid­gets.  It is actu­ally a well-crafted tool, I have just never had a need for it.  It turns out that one of the pre­made appli­ca­tion tem­plates is for dis­play­ing upcom­ing cal­en­dar events from a pub­lished iCal feed.  The parser not not only han­dles one-time events, but repeat­ing ones.  It is writ­ten in JavaScript and makes good use of object-oriented tech­niques, includ­ing objects for the cal­en­dar, event, time­zones, recur­ring rules, and the file parser.  Pre­vi­ously, writ­ing a full parser and cal­en­dar engine was a lit­tle beyond the scope of the project that called for a cal­en­dar feed.  Now, it looks like it might be just a sim­ple trans­la­tion of JavaScript to Objective-C (plus some unit tests to catch pos­si­ble tran­scrip­tion errors).

Share and Enjoy:
  • Digg
  • Reddit
  • del.icio.us
  • StumbleUpon
  • Yahoo! Buzz
  • Facebook
  • Google Bookmarks
  • Technorati

If you liked this post, you may also enjoy:

  1. The hor­rors of inter­net cal­en­dar formats
  2. LJProxy: From friend-locked Live­Jour­nal posts to Google Reader
  3. LOLCODE
  4. del.icio.us
  5. iPhone Impres­sions

Leave a Comment

Previous post:

Next post: