nextcloud / calendar

📆 Calendar app for Nextcloud
https://apps.nextcloud.com/apps/calendar
GNU Affero General Public License v3.0
986 stars 239 forks source link

Alarm trigger doesn't consider timezone #1940

Open tcitworld opened 4 years ago

tcitworld commented 4 years ago

Note: Not sure where to post this issue, since I'm not sure on how to understand RFCs.

Steps to reproduce

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!](https://www.bountysource.com/issues/87810763-alarm-trigger-doesn-t-consider-timezone?utm_campaign=plugin&utm_content=tracker%2F45525646&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F45525646&utm_medium=issues&utm_source=github).
georgehrke commented 4 years ago

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.

tcitworld commented 4 years ago

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 ?

georgehrke commented 4 years ago

Yes, there are two things to fix:

miaulalala commented 2 months ago

Still an issue on Calendar 5.0.0 - I added two reminders but they were triggered late

miaulalala commented 2 months ago

Possibly related to https://github.com/nextcloud/server/issues/43113