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.