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

Firefox bad about time zones? #87

Open
mcdemarco opened this issue Feb 18, 2022 · 7 comments
Open

Firefox bad about time zones? #87

mcdemarco opened this issue Feb 18, 2022 · 7 comments

Comments

@mcdemarco
Copy link
Contributor

I was testing something else in Boskone's ConClar on Firefox and I noticed it was very confused about my timezone, even after I turned fingerprinting protection off for the website. It was fine for me because I could just turn off the spurious and wrong local time, but it would be a problem if I were actually in a different time zone from the con and got the wrong local times. Google seems to think this can happen from profile corruption, but my profile is not otherwise detectably corrupt.

@mcdemarco
Copy link
Contributor Author

Some related issues:

  • I had a feature request for setting the user's "local" time zone manually. react-timezone-select would be useful for that.
  • The discussion in issue Show past items filter #47 recommends unifying the existing time zone handling.

@lostcarpark
Copy link
Owner

I have carried out a revamp of time handling using the Temporal API.
This is expected to become part of the JavaScript standard soon, but until it's widely supported in browsers, I've used the "@js-temporal/polyfill" library to provide it.
This should provide more robust timezone handling going forward. It also allows the time handling and formatting to be considerably simplified.
In particular, calculating the offset between the convention timezone and local timezone is significantly simplified. The offset is now only used to check if the user is in a different timezone from the convention, and needs to be offered local time.
Previously, the offset was used to adjust the times, which meant the offset had to be the same for the whole weekend, which could cause problems for conventions over daylight savings changeover weekends. Now each timeslot is converted to the local timezone by the Temporal API so the correct local time should be shown for each timeslot.

I've only applied the Temporal API to the date and times displayed. I will look at the "Show past items filter" soon, as I think it should also simplify this.

@mcdemarco
Copy link
Contributor Author

I wasn't expecting the changes to help, and they didn't. I tested this in an easier way this time, just building from source and comparing Chrome's idea of my local time on the Octocon schedule to Firefox's. Firefox still seems to be using UTC for my local time.

@lostcarpark
Copy link
Owner

That is mysterious. It's possible that there's a Firefox bug I'm missing because my timezone until very recently was UTC (we've just moved to Irish Summer Time which is UTC +1).

I'm going to be in Europe for a few days, so will do some testing. I might need to manually move my timezone to try out different timezones.

@lostcarpark
Copy link
Owner

I'm trying some stuff that I hope will fix this. At present, I'm displaying time in the default local timezone. I'm working on a change that will fetch the timezone name from the browser, and explicitly display in that timezone. In theory the only way this could fail is if the browser returns the wrong timezone name.

I'll open a new issue for the other timezone changes I'm working on.

@lostcarpark
Copy link
Owner

I have created pull request #98, which should resolve this.
Any assistance reviewing and testing the change would be appreciated.

@lostcarpark
Copy link
Owner

@mcdemarco PR #98 now merged, and I hope these issues should now be resolved. I'm not sure if there's a bug around getting local timezone in FireFox on Mac, but I've tested that it gets the correct one in Windows and Linux.

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

No branches or pull requests

2 participants