You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Someone just added an event to their calendar for someone's birthday (on Sat, Jul 20), and it's being treated as a 24-hour event from 5 p.m. tomorrow (Fri, Jul 19) until 5 p.m. the next day because the API returns:
and m.c.google just relies on m.u.iso8601 extracting the '-07:00' to adjust things correctly. However, while all-day events don't include any time zone information at all, service.events().list() still returns the calendar's default time zone, so theoretically that could be extracted and bundled in (though that would mean m.u.iso8601 would either need to switch entirely over to using pytz, or use two entirely different approaches for doing time zone calculations).
It is possible for a calendar to have one default time zone and a Telegram group to configure the bot to present events in a different time zone, in which case even with the above the events will still not run midnight to midnight.
Alternatively, the all-day nature of the event could be preserved all the way out to m.u.eventutil.format_event, but I'm leaning toward ignoring this until I see it actually happening. (All-day events in general are pretty rare in practice.)
The text was updated successfully, but these errors were encountered:
Someone just added an event to their calendar for someone's birthday (on Sat, Jul 20), and it's being treated as a 24-hour event from 5 p.m. tomorrow (Fri, Jul 19) until 5 p.m. the next day because the API returns:
and
m.c.google.Calendar.datetime_proto_to_local
just passes'2024-07-20'
through:metabot/metabot/util/iso8601.py
Lines 7 to 22 in d0110b6
which correctly (if naively) gives midnight UTC on 2024-07-20 (which is 5 p.m. the day before in America/Los_Angeles).
Somewhat weirdly, non-all-day events include time zone information in both the date spec and a separate
timeZone
field:and
m.c.google
just relies onm.u.iso8601
extracting the'-07:00'
to adjust things correctly. However, while all-day events don't include any time zone information at all,service.events().list()
still returns the calendar's default time zone, so theoretically that could be extracted and bundled in (though that would meanm.u.iso8601
would either need to switch entirely over to using pytz, or use two entirely different approaches for doing time zone calculations).It is possible for a calendar to have one default time zone and a Telegram group to configure the bot to present events in a different time zone, in which case even with the above the events will still not run midnight to midnight.
Alternatively, the all-day nature of the event could be preserved all the way out to
m.u.eventutil.format_event
, but I'm leaning toward ignoring this until I see it actually happening. (All-day events in general are pretty rare in practice.)The text was updated successfully, but these errors were encountered: