Alarm trigger doesn't consider timezone
Note: Not sure where to post this issue, since I'm not sure on how to understand RFCs.
Steps to reproduce
- Be on another TZ than UTC (calendar must have this TZ)
- Add a full day event
- Add a reminder "on the day of the event" at a certain time, say 17:30 here
Result
DTSTART;VALUE=DATE:20200130
DTEND;VALUE=DATE:20200202
[â‹…â‹…â‹…]
BEGIN:VALARM
ACTION:EMAIL
TRIGGER;RELATED=START:PT17H30M
END:VALARM
This will be interpreted by server as 17H30 UTC, not in user's local timezone. Since it's a full day event, the event DTSTART hasn't got any timezone information, and sabre/object doesn't seem to consider the calendar's VTIMEZONE to get effective trigger time.
RFC 5545 says
The "TRIGGER" property specifies a duration prior to the start of an event or a to-do. The "TRIGGER" edge may be explicitly set to be relative to the "START" or "END" of the event or to-do with the "RELATED" parameter of the "TRIGGER" property. The "TRIGGER" property value type can alternatively be set to an absolute calendar date with UTC time.
So…I'm guessing it's 17:30 relative to an UTC date after all, but it's quite odd for users to expect this. Should we only work with absolute dates instead ?
Evolution and Thunderbird Lightning don't really offer such a functionality. And Google Calendar only has gives TRIGGER:P0DT17H30M0S for the same parameters…
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The UTC in your quote refers to something like:
TRIGGER;VALUE=DATE-TIME:19970317T133000Z
As far as i know, floating time and triggers for all-day events should be treated on the basis of the device time or in case that's not available the calendar-timezone property on the calendar.
For simplicities sake, server is just taking UTC for all events right now. If we treat it based on the calendar-timezone property, it will get more complex, because sharees can set a custom calendar-timezone property for their calendar. So for each sharee, we have to check if they are in a different timezone and send reminders separately.
For simplicities sake, server is just taking UTC for all events right now. If we treat it based on the calendar-timezone property, it will get more complex, because sharees can set a custom calendar-timezone property for their calendar. So for each sharee, we have to check if they are in a different timezone and send reminders separately.
OK, can we move this to server then ?
Yes, there are two things to fix:
- Handle all-day events and floating events based on calendar-time for reminders (dav app)
- Whenever the user changes the timezone in the calendar (both changing manually and a change when having timezone set to automatic), we have to send PropPatch requests to the server to update the calendar-timezone property on all calendars. (That's also what macOS calendar does)
Still an issue on Calendar 5.0.0 - I added two reminders but they were triggered late
Possibly related to https://github.com/nextcloud/server/issues/43113