Closed ErisDS closed 9 years ago
I searched a little and found a nice time zone list on Wikipedia with 40 options that should cover it all. But how do we handle the daylight saving times? I think instead of implementing our own list and logic we should implement moment.js.
@jwillmer That's exactly what this issue is about - we would like to use moment.js (as described in https://github.com/TryGhost/Ghost/issues/1265#issuecomment-26999861), but the list that comes with moment.js timezone is incredibly long. We only want the really necessary subset of timezones.
@halfdan Then I would propose to use the list from Wikipedia. I have removed the offsets for summer time and came up with a 38 entry long list. If we remove offsets with 15min and 30min difference we get a list with 25 entrys.
Offsets with 15m/30m? Those are separate timezones (e.g. Northern Territory - Australian Central Time Zone is UTC+09:30).
Sure, but how else would you minimize the list? @halfdan
That's what this issue is here for, for someone to do extensive research into what time zones we should support and why.
Why should we use the wikipedia list? What is it a list of? Where does it come from? Why is it right for Ghost?
I have a lot of questions!
If Ghost is going to be supported world-wide, I think we'll need more than 38 time zones. ICANN maintains currently 548 time zones. This is the list used by a lot of big software projects, notably in OSs like BSD and OSX, and natively in languages like C, PHP, and Java, with a few already available implementations in JavaScript.
That's a big list - it wouldn't make sense to present that many options in a dropdown. One suggestion to get around this is to implement a timezone picker similar to that of Ubuntu's install wizard. After some DDG'ing I found this picker, which is similar to what I'm imagining.
+1 to a world map instead of a drop down. GeoIP could be used to determine location. Perhaps Maxmind's GeoLite2 database (which is free) could be used as an initial estimate, and then the user could be allowed to either correct that or narrow down their location. Apple seems to use GeoNames for populating their world map; perhaps it could be used to help give the user some options in narrowing down their location. Once their location is set, something like moment.js could be used to assign the correct time zone.
It probably wouldn't be that simple, but that's an approach I'd investigate if I were doing this.
The problem with using geolocation is that I may be a blogger in Thailand, but for reliability purposes, I'd be using a server on the west coast of the US. Some IP addresses could be home to servers in several timezones, so it'd be quite ambiguous.
Reason it works on an OS is it's sitting on an endpoint, where the user is physically.
how about doing the Geolocation look-up when the user logs in to set up the site, this way the lookup can use the users current location instead of the location of the server.
Geolocation would require us to either ship the GeoIP database or make an external API request - the first is big in size, the second could fail. IP based Geolocation is also prone to errors.
This discussion is great, but we desperately need to get this option into the UI in a simple form for now - there have been extensive discussions about this in #1265. We are well aware that there are nicer ways that this could be done in future.
This issue requested that someone do the necessary research to determine the best list of timezones to start with so that we can get this working. The conversation about GeoIP is derailing the issue in my opinion, and if it warrants serious consideration for future, it should be on #1265, not here.
I'll do an initial research tonight. I think we'll need to omit the really obscure ones, however if there's a checkbox for advanced config, they can be made to appear.
yay / nay on partial hide for the obscure ones?
yay for partial hide. :-)
I'd be interested to see what the result of the research is - other people have dibbs/PRs open on implementation for when we get there :wink:
So far my findings:
There's the Olsen database (hat tip to https://github.com/rmccue), which is the ICANN one mentioned by @dsschnau. The whole concept of that is that it's collaborative, and there are no overlaps, because all of them differ from the other in one way or another.
So what I propose is a dropdown that has the most used by default, and a search if someone doesn't find theirs in the main ones. We could also potentially hook it up with some measurement to know which are the most used ones according to actual data. Both Select2 and Chosen have an ability to do magic with dropdown boxes.
The initial ones could be determined by actual usage of Ghost, @ErisDS is to send me a list soon hopefully :).
If we implement a map based timepicker, http://timezonepicker.com/ is a great starting point (obviously modified to accommodate moment.js's timezones and format), and could be designed to look / feel superamazeballs. The imagemap can be replaced by either a google maps implementation with fusion tables or a big svg.
Thoughts?
For the lolz: https://www.youtube.com/watch?v=-5wpm-gesOY&feature=youtu.be (thanks @bastilian)
Amazing! Don't have much to add to the amazing research done by @javorszky. I like the idea of a dropdown with optional search.
I really like the idea of using the Ubuntu-inspired idea and an edited version of moment.js. The user loves being able to choose! :yum:
Worth looking at @javorszky's comment about using Google's API, too.
Closing all the timezone related issues with the label later
this is stalled. Will reopen when we're ready to attack this with a plan.
There is more info here: https://github.com/TryGhost/Ghost/issues/1265#issuecomment-35809646
In short, we want to research and determine what time zones should be included in the list, taking into account keeping the list usable (so as short as possible) but not excluding anyone.
Here are 2 example lists:
As far as I can see, there are ~30 unique options in the lists, but again, I guess there must be reasons for showing so many duplicates - I assume again because some places have different rules for how and when the timezones change through the year?