Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a few improvements on guessing timezones.
All current timezones now have a rough population estimate to help as a tiebreaker. The populations are based on https://en.wikipedia.org/wiki/List_of_urban_areas_by_population and googling
X population
. We are not incredibly concerned with accuracy here, one digit of precision is usually enough to differentiate between two similar zones.2. The timezone's abbreviation is taken into consideration if possible.
3. The scoring algorithm is more granular. We take a handful of samples of the offsets and abbrs in the 4 years surrounding the current year using the binary search from #256. We then compare each zone's offsets and abbrs at those times with the browser reported offsets and abbrs.
4. Sorting is done first by offset differences in minutes, then by differences in abbrs, then by population. The end result is that we should be able to distinguish ~190 zones (see this commit) with browser abbr information, and ~60 without browser abbr information.
The next step after this is merged is to pre-filter guesses here so that we are not unpacking every zone when guessing the zone.
cc @mj1856