Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix icalendar timezones #7450

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix icalendar timezones #7450

wants to merge 2 commits into from

Conversation

leoleoasd
Copy link

@leoleoasd leoleoasd commented Sep 9, 2023

fixes #7456

Currently, icalendar module will treat all times as local timezones. Also, TZID in DTSTART of icalendar events are ignored, resulting more confusing result (as events with local timezones are displayed correctly but events with other TZID are shifted).
This PR fixes both these problems.

  1. use toJSDate().toISOString() as ical.js's toString() method don't include timezones other than UTC or local:

https://github.com/kewisch/ical.js/blob/b8157d34d61ce15843ea55cd05d9028414ccfdff/lib/ical/time.js#L1055-L1071

  1. add timezone info to ical.js

@acerix
Copy link
Member

acerix commented Sep 11, 2023

Please submit this ticket under Issues with a runnable, stripped-down demonstration of the bug, then link this PR to it. I found a similar issue #7364 but it sounds like not the same as what this is fixing.

@leoleoasd
Copy link
Author

I discovered my problem and write this fix, this MAY fix #7364 as well but I havn't tested.

@leoleoasd
Copy link
Author

Before:
(Event should start at 12:00 and end at 13:00 in china timezone; I used devtools to change the timezone to china)
image_2023-09-16_15-00-19
(Event should start at 00:09 and end at 01:09 in ET; No devtool option used so it should my local TZ which is UTC-4)
image_2023-09-16_15-05-15
After:
image_2023-09-16_15-06-11

@leoleoasd
Copy link
Author

Any update? @acerix @arshaw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICalendar events with 'TZID' displayed in wrong timezone
3 participants