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

Do all timezone calculations in libical #709

Merged
merged 31 commits into from
Oct 15, 2021

Conversation

mcclurgm
Copy link
Collaborator

@mcclurgm mcclurgm commented Sep 25, 2021

Fixes #572, possibly others

As discussed in #660, the conversion process from libical to GLib timezones is very brittle. The most visible result is that Windows-style timezones (Western European Standard Time) are not handled.

This PR moves all timezone logic to libical, which should have access to all the necessary information to run timezone conversions properly, regardless of whether the timezone corresponds to a system built-in. I accomplished this by modifying the functions that convert ICal.Time and ICal.Component to GLib.DateTime.

Basically, the change in this PR is converting the timezone in libical before calling icaltime_to_datetime, instead of converting after in GLib. That's the only subtantive change, really.

One restriction is that some of thsee convert to DateTimes in non-local timezones. Since it's not always possible to get a GLib.TimeZone for these cases, the timezone in resulting DateTimes isn't guaranteed to be correct. I documented this restriction with emphasis, but it's still not ideal.

I added lots of tests to make sure this works as intended. So I'm pretty sure the new/modified functions all work properly, but the question is if there are any clients that need to be fixed. A text search for function calls didn't reveal anything, but in review I'd appreciate some help looking. If there are no weird cases I missed, then the modified functions should be a drop-in replacement.

Sorry for the terrible commit history. It includes some duplicate work from #653. I'd recommend looking at only the changed files for review, and committing using squash for sure.

mcclurgm and others added 28 commits February 20, 2021 08:19
Some of them fail and that's ok, since I'll be reimplementing the
bad code soon!
Function doesn't need to change, but depends on logic
that is changing
@mcclurgm mcclurgm requested a review from a team September 25, 2021 20:31
@danirabbit danirabbit requested a review from tintou October 13, 2021 18:43
@danirabbit danirabbit merged commit 1099ba6 into elementary:master Oct 15, 2021
@danirabbit
Copy link
Member

Thanks for all of your work on this!

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.

Windows timezones are not handled
3 participants