Skip Menu |

This queue is for tickets about the Data-ICal CPAN distribution.

Report information
The Basics
Id: 17257
Status: resolved
Priority: 0/
Queue: Data-ICal

People
Owner: Nobody in particular
Requestors: mark [...] summersault.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.04
Fixed in: (no value)



Subject: wish: short cut for "all day" events
Many calendar interfaces have the notion of an "all day" event, although it appears the ICal spec doesn't have a special way to account for this. Instead, such events are denoted as happening from midnight to midnight (and thus, I suppose, they are exactly "all day"). I wish for an "all day" property as shorthand for this. When combined with the a "dtstart" that is a date (not a date-time), it will create resulting values for "dtstart" and "dtend" that in the midnight to midnight format that ICal expects. I may work on this myself, but it would be nice to have some feedback to guage interest (and peer review my logic!). Thanks, Mark.
Breaking news: This could be just a case where better docs are needed. I found this snipped in ICal::Parser: # stolen from Text::vFile::asData example $e{allday}=1 if _param($event,'DTSTART','VALUE')||'' eq 'DATE'; This indicates different logic. And since these two other Perl modules agree on it, I'll trust they've already figured this out. The answer then for creating an all day event is to just give a date: dtstart => [ $YYYYMMDD, { VALUE => 'DATE' } ] I'll test that, and then submit a documentation patch to explain it if my desktop calendar programs accept this.
I've got a somewhat definitive answer about this by testing with Sunbird (0.2). It stores "all day" events like this: DTSTART;VALUE=DATE:20060124 DTEND;VALUE=DATE:20060125 Ah, I see this functionality is already in Data::Ical::DateTime: http://search.cpan.org/~simonw/Data-ICal-DateTime-0.64/lib/Data/ICal/DateTime.pm#all_day There it works exactly as above. Since we'll have to do a date calculation to calculate the end date, maybe I should just be using that module instead, as I see that Data::ICal thus far manages not to depend on any date modules.
Attached is a proposed resolution, which is to just add documentation about how to use Data::ICal::DateTime to do this, which seems like a fine solution to me. Mark
--- old-mark/perllib/Data/ICal/Entry/Event.pm 2006-01-20 16:00:26.000000000 -0500 +++ new-mark-1/perllib/Data/ICal/Entry/Event.pm 2006-01-25 09:20:02.000000000 -0500 @@ -87,6 +87,17 @@ ); } +=head1 SEE ALSO + +=over 4 + +=item L<Data::ICal::DateTime> - for date parsing and formatting, including denoting +"all day" events, considering using this module. Because it's a "mix in", you +can still use all the methods here as well as the new date handling methods it +defines. + +=back + =head1 AUTHOR Jesse Vincent C<< <jesse@bestpractical.com> >> with David Glasser and Simon Wistow