Importinc an ical apointment is shown 1 Hr later
-
@bhuisman
Dear Bob,
sorry for replying so late.
I can´t find a timezone Setting. Please have a look:BEGIN:VCALENDAR
PRODID:EUROWINGS
CALSCALE:GREGORIAN
VERSION:2.0
BEGIN:VEVENT
DTSTART:20200227T155500
DTEND:20200227T165500
LOCATION:Düsseldorf
SUMMARY:Flug nach Hamburg
DESCRIPTION:Buchungscode: XXXXXX
Von: Düsseldorf
Nach: Hamburg
Abflug: 27.02.2020 15:55
Ankunft: 27.02.2020 16:55
Disclaimer
Passagiere:
xxx yyy
CLASS:PUBLIC
END:VEVENT
END:VCALENDARAfter impoting this topc with Outlook everything is correct.
After importing the WEB - of FAT Client i´ll got a shift of 1 Hr.
Thanks in Advance for helping me.
BR Thomas -
@strippe96
I have found the reason for this timeshift:DTSTART:20200227T155500
DTEND:20200227T165500was Date & Time. It seems, that Kopano Webapp assumes this as
DTSTART:20200227T155500Z
DTEND:20200227T165500Zand not for timezone Europe/Berlin.
Could this be a bug?
BR THomas
-
@strippe96 Found the bug:
Pls. have a look to /usr/share/kopano-webapp/plugins/files/php/Files/Backend/Webdav/sabredav/vendor/sabre/vobject/lib/Sabre/VObject/Property/DateTime.php at line 246. If an Appointment without Timezone ( eg. “Z” -> DTSTART:20200227T155500 ) is passed to function setDateTime, the function assumed type “LOCAL” and does not take care of the local timezone. Inserting
$this->offsetSet(‘TZID’, $dt->getTimeZone()->getName());
just before the “break;” will sove this.
BR Thomas
-
Line 246 does not exist in that file.
The extra hour is also added without having files plugin on the server.
-
Sorry, my failure. Please add the line (No 76) “$this->offsetSet(‘TZID’, $dt->getTimeZone()->getName());” in “case self::LOCAL :” just before “break;”
public function setDateTime(\DateTime $dt, $dateType = self::LOCALTZ) { switch($dateType) { case self::LOCAL : $this->setValue($dt->format('Ymd\\THis')); $this->offsetUnset('VALUE'); $this->offsetUnset('TZID'); $this->offsetSet('VALUE','DATE-TIME'); $this->offsetSet('TZID', $dt->getTimeZone()->getName()); break; case self::UTC : $dt->setTimeZone(new \DateTimeZone('UTC')); $this->setValue($dt->format('Ymd\\THis\\Z')); $this->offsetUnset('VALUE'); $this->offsetUnset('TZID'); $this->offsetSet('VALUE','DATE-TIME'); break; case self::LOCALTZ : $this->setValue($dt->format('Ymd\\THis')); $this->offsetUnset('VALUE'); $this->offsetUnset('TZID'); $this->offsetSet('VALUE','DATE-TIME'); $this->offsetSet('TZID', $dt->getTimeZone()->getName()); break; case self::DATE : $this->setValue($dt->format('Ymd')); $this->offsetUnset('VALUE'); $this->offsetUnset('TZID'); $this->offsetSet('VALUE','DATE'); break; default : throw new \InvalidArgumentException('You must pass a valid dateType constant'); } $this->dateTime = $dt; $this->dateType = $dateType; }
Cheers, Thomas
-
What makes you think this code is used while importing an ics?
-
@marty Dear Marty,
when I´ll try to Import an ICS-file, where the DTSTART / DTEND Tags are noted without a timezone marker (e.g. “Z” at the End), the Appointment will be 1 hr later in the Calendar. This is fixed after applying this Change. All Appointments are shown at the correct time.
-
@strippe96 Can you try to reproduce it without this plugin installed on the server
(I could, as stated before) -
@marty Sorry Marty, I´ll missunderstood you. Can you please explain, witch module and how to deinstall?
Thanks in Advance.Thomas
-
@strippe96
The code you modified is from an external module inside the files plugin.Without the files plugin, the described behavior i.e. bug is also reproducible.
And a fix for WebApp in an external plugin is not a good idea. -
@marty Hey marty, after removing files, I´ve got the same result. 1 Hr in advance.
-
@marty From my point of view, I´ll want to say, that this module is “fromoutside to webapp” but it´s local to the files module. This function seems to be used only if files (importing an appointment e.g.) is using it.
For me, it´s ok to change it here. Isn´t it?