justinmimbs / timezone-data

An Elm package containing time zone data from the IANA Time Zone Database
https://package.elm-lang.org/packages/justinmimbs/timezone-data/latest/
BSD 3-Clause "New" or "Revised" License
30 stars 5 forks source link

Add 'links' for older timezone indicators. #7

Closed erlandsona closed 1 year ago

erlandsona commented 1 year ago

As described on the Wikipedia page here. https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

justinmimbs commented 1 year ago

Hi Austin, the data in TimeZone.elm is not updated manually, but it's generated by parsing the tz database. Take a look at build.sh and build.py, which do this.

erlandsona commented 1 year ago

Yeh but apparently the build script isn't capturing "links" in the output? I just installed the latest and our sister team in Kyiv ran into the fact that their machines are reporting "Europe/Kiev" not "Europe/Kyiv".

So the build scripts are missing the "linked" TZ's.

erlandsona commented 1 year ago

The list in this PR is represented by running this scrapper over the wikipedia above.

links = Array(...document.querySelector('.wikitable tbody').querySelectorAll('tr')).flatMap(row => row.children[3].innerText.slice(0,4) === 'Link' ? [{from: row.children[1].innerText, to: Array(...row.children).slice(-1)[0].innerText.substring(8)}] : [])
justinmimbs commented 1 year ago

To support deprecated links, this library should build them from the backward file.

Just to be clear:

erlandsona commented 1 year ago

Ah okay, that sounds like what we ran into. Closing as I assume this isn't "in scope" of the intended use case and I'm sure if someone else runs into it this this issue should provide enough for them to decide how to proceed.

Thanks a ton!