-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
Hi!
I am not sure if this is a new problem in Google Calendar but it seems now that it does not like the TZID in the time zone definition block when importing an ICS file generated by this library. The events of the ICS file are not displayed in Google Calendar if the time zone block looks like this:
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:STANDARD
DTSTART;TZID=+00:00:20201025T010000
It works fine when using an UTC time instead:
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:STANDARD
DTSTART:20201025T010000Z
The file CalendarExport.php creates the upper block in "local-tz" mode:
if ($this->dateTimeFormat === 'local') {
${$varName}['start'] = ':' . $this->formatter->getFormattedDateTime(new \DateTime($transition['time']));
} else if ($this->dateTimeFormat === 'utc') {
${$varName}['start'] = ':' . $this->formatter->getFormattedUTCDateTime(new \DateTime($transition['time']));
} else if ($this->dateTimeFormat == 'local-tz') {
${$varName}['start'] = ';' . $this->formatter->getFormattedDateTimeWithTimeZone(new \DateTime($transition['time']));
}
I would suggest to use the same mode as in "utc" to fix this:
if ($this->dateTimeFormat === 'local') {
${$varName}['start'] = ':' . $this->formatter->getFormattedDateTime(new \DateTime($transition['time']));
} else if ($this->dateTimeFormat === 'utc') {
${$varName}['start'] = ':' . $this->formatter->getFormattedUTCDateTime(new \DateTime($transition['time']));
} else if ($this->dateTimeFormat == 'local-tz') {
${$varName}['start'] = ':' . $this->formatter->getFormattedUTCDateTime(new \DateTime($transition['time']));
}
What do you think? Or is there a reason why getFormattedDateTimeWithTimeZone was used instead?
Metadata
Metadata
Assignees
Labels
No labels