On Thu, Sep 15, 2005 at 04:16:53PM -0400, Matt Sisk said: > I just noticed Data::ICal out on the CPAN and was wondering if you'd taken a > look at it. It seems fairly comprehensive on parsing and generating ICal data. > Perhaps it's worth keeping an eye on for potential use in the various ICal > datetime modules (though "if it ain't broke, don't fix it" probably applies in > this case).
FWIW I wrote Data::ICal::DateTime which puts various DateTime based convenience wrappers round Data::ICal For example use Data::ICal::DateTime; # uses mixins my $span = DateTime::Span( start => $d1, end => $d2 ); my $ical = Data::ICal->new( filename => $ics ); foreach my $events ($ical->events($span)) { print "Start: ".$event->start; # start is a DT object print "End: ".$event->end; # ditto # ... } events() in this case will automatically generate all the recurring event instances within that $span including handling Recurrence-IDs (which are how you add additional data to a recurring event instance - for example generate a Birthday recurring event and then note that the location is so and so restaurant this year). It also has the ability to 'explode' multi period events by doing something like ->events($span, 'day') I'm currently using it to write a calendering web app that can aggregate several sources (including syndicated web accessible .ics files) and as I go along I'm unconvering several little interface quirks and bugs but it seems to be working out well so far. All comments and suggestions gratefully received. Simon