Page MenuHomePhabricator

Present list of matching timezone locations based on client offset
Closed, DeclinedPublic

Description

With bug 505 fixed, users will now be able to specify a zoneinfo timezone name (such as "America/Los_Angeles") in place of a manually-calculated offset ("-08:00").

This is good, but the list of places is long -- 445 entries currently come up in the list available on my test installation. Even if localization of names is added, the list isn't super easy to pick from.

For a long time we've had a button to fill in the offset from the client computer's settings via JavaScript, but this only gives us the current offset; we need a zone location to handle DST transitions.

It would, however, be possible to show a restricted list which matches the client settings. For instance a match for -08:00 in December would require only picking from:

+---------------------+
| America/Dawson      | 
| America/Ensenada    | 
| America/Los_Angeles | 
| America/Tijuana     | 
| America/Vancouver   | 
| America/Whitehorse  | 
| Pacific/Pitcairn    | 
+---------------------+

At the moment (December 2008), the biggest list would be for UTC+1, which comes up with 46 locations in Africa and Europe.

Here's a breakdown, with some locations just for fun:

+---------+----------+
| minutes | count(*) |
+---------+----------+
|    -660 |        5 | 
|    -600 |        7 | <- Hawaii
|    -570 |        1 |
|    -540 |        5 | 
|    -480 |        7 | <- US west coast
|    -420 |       12 |
|    -360 |       23 |
|    -300 |       36 | <- US east coast
|    -270 |        1 | 
|    -240 |       33 | 
|    -210 |        1 | 
|    -180 |       18 | 
|    -120 |       21 | 
|     -60 |        3 | 
|       0 |       30 | <- UK
|      60 |       46 | <- Europe
|     120 |       40 |
|     180 |       21 | <- Moscow 
|     210 |        1 | 
|     240 |        9 | 
|     270 |        1 | 
|     300 |       12 | 
|     330 |        3 | 
|     345 |        1 | 
|     360 |       12 | 
|     390 |        2 | 
|     420 |       11 | <- Australia west coast (DST)
|     480 |       21 | <- China
|     540 |       10 | <- Japan, Korea, Australia east coast (DST)
|     570 |        2 | 
|     585 |        1 | 
|     600 |       10 | 
|     630 |        4 | 
|     660 |       17 | 
|     690 |        1 | 
|     720 |       10 | <- New Zealand (DST)
|     780 |        5 | 
|     825 |        1 | 
|     840 |        1 | 
+---------+----------+

Version: 1.24rc
Severity: enhancement
URL: http://en.wikipedia.org/wiki/Special:Preferences

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:28 PM
bzimport set Reference to bz16763.
bzimport added a subscriber: Unknown Object (MLST).

I'm using this sort of pruning with a visual display in [[mw:Extension:TimeZonePicker]], still experimental.

Still valid in 2014; "Time zone" field on https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering under mw-prefsection-rendering-timeoffset offers only:

  • "Fill in from browser" (guesstimezone)
  • "Other (specify offset)" (timezoneuseoffset)

but not taking the timezone from the browser and then choosing the exact timezone (and DST settings of a country) based on a list of locations limited to locations in that timezone.

matmarex subscribed.

For a long time we've had a button to fill in the offset from the client computer's settings via JavaScript, but this only gives us the current offset; we need a zone location to handle DST transitions.

As of 2020, it is possible to get the time zone via JavaScript, rather than only the time offset (it wasn't possible when this task was written :) ). We could upgrade the button to do that. I think that is a better solution to the problem.

https://stackoverflow.com/questions/9772955/how-can-i-get-the-timezone-name-in-javascript/44935836#44935836

Change 566883 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] mw.special.preferences: Allow filling in real time zone instead of offset

https://gerrit.wikimedia.org/r/566883

This is much better than my originally suggested hack. :) +2'ing it.

Change 566883 merged by jenkins-bot:
[mediawiki/core@master] mw.special.preferences: Allow filling in real time zone instead of offset

https://gerrit.wikimedia.org/r/566883

matmarex changed the task status from Resolved to Declined.Jan 26 2020, 6:20 PM

(I guess this is more appropriate? I don't want to rewrite the whole description :) )