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

Automatically select timezone based on venue location #4487

Open
timreyn opened this issue Aug 15, 2019 · 10 comments
Open

Automatically select timezone based on venue location #4487

timreyn opened this issue Aug 15, 2019 · 10 comments
Labels
META: good second issue More involved than first issue, these help get a deeper understanding of the codebase TYPE: feature-request Request for additional functionality to be added to the WCA website

Comments

@timreyn
Copy link
Contributor

timreyn commented Aug 15, 2019

Is your feature request related to a problem? Please describe.
The most common time zone used for US competition venues is...

mysql> select timezone_id, count(1) from competition_venues join Competitions on competition_id = Competitions.id where countryId="USA" group by 1 order by 2 desc;
+------------------------------+----------+
| timezone_id                  | count(1) |
+------------------------------+----------+
| America/Adak                 |      111 |
| America/New_York             |       53 |
| America/Chicago              |       37 |
| America/Los_Angeles          |       28 |
| America/Denver               |        9 |
| America/Detroit              |        4 |
| America/Phoenix              |        3 |
| America/Boise                |        3 |
| America/Kentucky/Louisville  |        3 |
| America/Indiana/Indianapolis |        2 |
| America/North_Dakota/Center  |        1 |
+------------------------------+----------+
11 rows in set (0.01 sec)

America/Adak! It's a small timezone in the Aleutian Islands in Alaska, with about 8,000 residents. America/Adak is also the first timezone alphabetically. I'm guessing many organizers see America, don't know what Adak is, and nothing tells them they're doing something wrong.

This means that any application of WCIF data which uses the schedule will be off by 4-7 hours for half of US competitions.

Describe the solution you'd like
Here's a gem that converts lat/long to timezone: https://github.com/panthomakos/timezone We could use this rather than having the organizer pick the time zone.

@timreyn timreyn changed the title Use geocoding for timezone Automatically select timezone based on venue location Aug 15, 2019
jfly added a commit to jfly/worldcubeassociation.org that referenced this issue Aug 18, 2019
Right now, we pick a default for them, which is probably fine in
countries with one timezone, but does *not* work well for countries with
multiple timezones. See
thewca#4487 for more
information.
@jfly
Copy link
Contributor

jfly commented Aug 18, 2019

Autoselecting the right timezone feels like a good long term solution. As a short term solution, I think it would make sense to force the user to pick a timezone. I've made that change over in #4503.

@AlbertoPdRF
Copy link
Contributor

Together with #4503, should we contact the Delegates that may have picked a wrong timezone and ask them to check/correct it?

jfly added a commit to jfly/worldcubeassociation.org that referenced this issue Aug 24, 2019
Right now, we pick a default for them, which is probably fine in
countries with one timezone, but does *not* work well for countries with
multiple timezones. See
thewca#4487 for more
information.
jfly added a commit that referenced this issue Aug 25, 2019
Right now, we pick a default for them, which is probably fine in
countries with one timezone, but does *not* work well for countries with
multiple timezones. See
#4487 for more
information.
@jfly
Copy link
Contributor

jfly commented Aug 25, 2019

@timreyn, do you think it would be better to reach out to delegates and ask them to fix this, or for us to instead just fix this as best we can based on the lat/long of the competition?

@timreyn
Copy link
Contributor Author

timreyn commented Aug 25, 2019

I think we should fix this ourselves, once we switch to automatically picking time zones and have code in place for converting lat/long to timezone. I don't think this is critical enough that we need to ask all delegates to fix this manually before we can do it automatically.

@jamesquinn1
Copy link

Somewhat unrelated, but is there an explanation for what time zones are options? There's 7 time zones for Indiana as options, and 3 for North Dakota and that seems quite random and unneeded, and makes the list of time zones far longer than it needs to be.

@timreyn
Copy link
Contributor Author

timreyn commented Sep 7, 2019

Yeah, this is a gap between "how programmers think about time zones" and "how real people think about time zones". We're using a thing called tz database (https://en.wikipedia.org/wiki/Tz_database).

This gets complicated for places like Indiana. Indiana has moved counties around a few times (https://en.wikipedia.org/wiki/Time_in_Indiana). e.g. Pulaski County switched from Eastern to Central for a year, and then went back, so if you just said "eastern time" instead of "America/Indiana/Winamac" then you'd get times wrong from April 2, 2006 to March 11, 2007.

I think this would all be easier if we didn't make people think about it, and just selected the right time zone automatically :)

@timreyn
Copy link
Contributor Author

timreyn commented Sep 7, 2019

@Samuel-Baird
Copy link

Samuel-Baird commented Oct 6, 2019

What about multi-location fmc competitions? Maybe this could be on by default but organizers have the ability to toggle it off.

Edit: didn’t know that it’s now possible to switch schedules for locations :P

@timreyn
Copy link
Contributor Author

timreyn commented Oct 6, 2019

Each venue has its own timezone. For a multi-location FMC competition, each venue would have its timezone selected automatically.

@Jambrose777 Jambrose777 added META: good second issue More involved than first issue, these help get a deeper understanding of the codebase idea labels Jun 18, 2021
@dunkOnIT dunkOnIT added the TYPE: feature-request Request for additional functionality to be added to the WCA website label Jun 29, 2022
@dunkOnIT
Copy link
Contributor

dunkOnIT commented Jan 1, 2025

We're doing this now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
META: good second issue More involved than first issue, these help get a deeper understanding of the codebase TYPE: feature-request Request for additional functionality to be added to the WCA website
Projects
Status: No status
Status: Done
Development

No branches or pull requests

7 participants