vvo / tzdb

πŸ•° Simplified, grouped and always up to date list of time zones, with major cities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in formatted string

ithielnor opened this issue Β· comments

The following zones have incorrect format and alternative names:

  • Antarctica/Palmer
  • America/Punta_Arenas
  • Africa/Casablanca
  • Africa/El_Aaiun
  • Europe/Istanbul,
  • Asia/Urumqi
  • Pacific/Bougainville

They all have the Alternative name GMT+/-offset and the formatted name as offset GMT+/-offset .... E.g. "-03:00 GMT-03:00 - Palmer, Rothera".

image

Hi there, so it seems to be an issue with the actual v8/Node.js data that is available, see:

> node
Welcome to Node.js v14.5.0.
Type ".help" for more information.
> Intl.DateTimeFormat("en", {timeZone: "Antarctica/Palmer", timeZoneName: "long"}).format(new Date())
'7/7/2020, GMT-03:00'
>

I propose we either:

It seems we're not alone here, see: https://www.zeitverschiebung.net/en/timezone/europe--istanbul vs https://www.zeitverschiebung.net/en/timezone/europe--paris

Perhaps both? It's conceivable that other such data issues will crop up in future so:

  1. Look for the Node alt name...
  2. ... if not found or looks like "^GMT" look in hardcoded list...
  3. ... if not found use timezone name.

Yep good idea, do you want to have a try at doing this change?

I will handle the other issue

I'm new to node.js so I'm not sure how to properly test this. I couldn't run index.js without errors on my box (node 14.5) but that's probably because I wasn't launching it right.

However, the js in this PR should be correct, just needs testing.

πŸŽ‰ This issue has been resolved in version 4.0.2 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€