Subject: | Data::ICal needs more than what is given by format_datetime() |
A correctly formatted DTSTART with a timezone is given as
DTSTART;TZID=US-Eastern:19970902T090000
Notice the ';' rather than a ':' after DTSTART.
The row must thus be formatted in a different way if it has a parameter.
It is not enough to let format_datetime() return a simple string. That
string must be examined in order to determine if a ':' or a ';' should
be used.
The Data::ICal module has a better way to do it, by giving all the
property parameters as a hash along with the value, like this;
$vevent->add_property(
'dtstart' =>
[
$start->datetime,
{
TZID => $start->time_zone_long_name,
},
],
);
That is, the iso8601 format is given as the fist value and the second
value is a reference to a hash with all the parameters. That will give a
correctly formatted row.
Could you create a new method named format_datetime_dataical() or maby
return the parameter hash as the second element in the return list if
called in list context?
Or maby, for compatability sake, add a new parameter to the method.
The new return value could be:
if( wantarray )
{
return( $base, {TZID=>$tz->name} );
}
... A separate suggestion for the same method. It would be nice to be
able to specify that you want the result in UTC even if the given date
is in a specific tz. Maby by calling
DateTime::Format::ICal->format_datetime($dt, {tz=>'UTC'})