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".
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:
- fallback to the original time zone name (like Antartica/Palmer) when this happens
- or we keep a manual list of abbreviations, like Europe/Istanbul is actually Turkey Time, https://www.timeanddate.com/time/zone/turkey/istanbul
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:
- Look for the Node alt name...
- ... if not found or looks like "^GMT" look in hardcoded list...
- ... 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 π¦π