I would like to propose three changes to dealing with time zones in the CalDAV backend.
- Add time zone to DATE-TIME properties
- Prefer TZID from DTSTART over VTIMEZONE
1. Add time zone to DATE-TIME properties
The ical RFC 5545 specifies 4 forms for DATE-TIME properties: https://tools.ietf.org/html/rfc5545#section-3.3.5
- DATE WITH LOCAL TIME (floating)
- DATE WITH UTC TIME
- DATE WITH LOCAL TIME AND TIME ZONE REFERENCE
- DATE (floating)
Right now we are using form 2 (for all-day events we use 4). By not storing the time zone we loose information. When creating an event in a different time zone, other devices do not know this.
I propose to switch to creating vevents with form 3 to keep time zone information.
2. Prefer TZID from DTSTART over VTIMEZONE
While parsing an VEVENT we read the first VTIMEZONE element and use that time zone for the message. This time zone might not be the correct time zone for the message. It could be that the first VTIMEZONE specifies summer time, while the start of the event is during winter time.
I propose to prefer the TZID parameter specified in DTSTART. If no TZID is set in DTSTART, then use the server default time zone.
If we all agree, I will make the changes and pull request.