Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: hanenkamp [...] cpan.org
Cc:
AdminCc:

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



Subject: TZID is mishandled on dates
If you have an event similar to this: BEGIN:VEVENT DTSTART;TZID=America/Chicago:20140927T203000 DTEND;TZID=America/Chicago:20140927T213000 UID:abc123 CREATED:20141026T002350Z DESCRIPTION:Join us at the blah blah blah SUMMARY:Test END:VEVENT The start and end dates will be setup in the floating time zone, which is quite wrong. Looking at the source I see a line like this in start() and a similar line in end(), why are these removed? # $ret->set_time_zone($dtstart->[0]->parameters->{TZID}) if $dtstart->[0]->parameters->{TZID}; This would fix the problem, I believe, though the if-condition is not safe since you don't know at that point in the code of $dtstart is actually defined. For those who encounter this, the work around is: # Time zone handling IN Data::ICal::DateTime is broked! my $start = $event->start; my $dtstart = $event->property('dtstart'); if ($dtstart && @$dtstart && $dtstart->[0]->parameters->{TZID}) { $start->set_time_zone($dtstart->[0]->parameters->{TZID}); } Found the source on github and intend to send a pull request shortly.
Or, maybe no pull request is necessary, just a release. I see the following modification has already been made in the place I previously pasted: eval { $ret->set_time_zone($dtend->[0]->parameters->{TZID}) } if ($dtend->[0]->parameters->{TZID}); This patch is 6 years old, but never released. On Sat Oct 25 23:18:24 2014, HANENKAMP wrote: Show quoted text
> If you have an event similar to this: > > BEGIN:VEVENT > DTSTART;TZID=America/Chicago:20140927T203000 > DTEND;TZID=America/Chicago:20140927T213000 > UID:abc123 > CREATED:20141026T002350Z > DESCRIPTION:Join us at the blah blah blah > SUMMARY:Test > END:VEVENT > > The start and end dates will be setup in the floating time zone, which > is quite wrong. Looking at the source I see a line like this in > start() and a similar line in end(), why are these removed? > > # $ret->set_time_zone($dtstart->[0]->parameters->{TZID}) if $dtstart-
> >[0]->parameters->{TZID};
> > This would fix the problem, I believe, though the if-condition is not > safe since you don't know at that point in the code of $dtstart is > actually defined. > > For those who encounter this, the work around is: > > # Time zone handling IN Data::ICal::DateTime is broked! > my $start = $event->start; > my $dtstart = $event->property('dtstart'); > if ($dtstart && @$dtstart && $dtstart->[0]->parameters->{TZID}) { > $start->set_time_zone($dtstart->[0]->parameters->{TZID}); > } > > Found the source on github and intend to send a pull request shortly.
Fixed in 0.8