moment-timezone
moment-timezone copied to clipboard
Needs the updated zone names
Moment-timezone version which you use:
Version: latest
Issue description:
Currently I'm using the library from India location
moment.tz.guess(true)
returns
"Asia/Calcutta"
moment.tz.zonesForCountry('IN')
returns
["Asia/Kolkata"]
Kolkata is a city in India and its name has been changes to Calcutta a few years back. Moment needs to give Asia/Calcutta when I call zonesForCountry method.
Asia/Calcutta is deprecated as Calcutta was old name of Kolkata
Asia/Calcutta is deprecated as Calcutta was old name of Kolkata
Then guess method should return the new name right? If yes then this is a bug
New name is Asia/Kolkata. Calcutta is old name
And the name was changed in 2001, not a few years back. It's been 20 years/2 decades
https://en.wikipedia.org/wiki/Kolkata
New name is Asia/Kolkata. Calcutta is old name
And the name was changed in 2001, not a few years back. It's been 20 years/2 decades
https://en.wikipedia.org/wiki/Kolkata
I think you are not getting the issue. moment.tz.guess returns Asia/Calcutta which is wrong. It should be the new name Asia/Kolkata
Kolkata is a city in India and its name has been changes to Calcutta a few years back. Moment needs to give Asia/Calcutta when I call zonesForCountry method.
That is not what you wrote in the issue. You wrote exactly opposite of that
The expectation is both the methods should return the same result. Since it doesn't, I asked why it can't support. But did you understand the issue?
I was just pointing out that what you have written in the issue: "Kolkata is a city in India and its name has been changes to Calcutta a few years back." is wrong.
"Moment needs to give Asia/Calcutta when I call zonesForCountry method." is wrong as well
It needs to return new name, "Asia/Kolkata" but I believe it is not a moment issue. It is a browser specific issue. moment.tz.guess()
gives "Asia/Calcutta" on Chrome, but "Asia/Kolkata" on Firefox
https://bugs.chromium.org/p/chromium/issues/detail?id=580195
@AshwinTayson long story short, moment-timezone uses IANA tzdata https://www.iana.org/time-zones. If you're really unhappy with the zone naming, you can submit a request to them, keep in mind they have strict rules on what can change and when, nevertheless we (moment-timezone) are not the right place to submit complaints timezone names.
Hi @ichernev - I see this thread is closed, but the concern of @AshwinTayson is not about zone naming but regarding data inconsistency.
We ran into a similar issue where moment.tz._zones
is returning a list of zones mapped with their corresponding time zones and we are taking it as a source of truth. For Asia_Kolkata it maps with timezone 'Asia/kolkata', but moment.tz.guess() returns 'Asia/Calcutta'. This is causing a data mismatch. Is there a way we can prevent that or make the data consistent across moment without having to depend upon chromium to fix their bug?
Unfortunately it seems some browsers/devices are still returning outdated zone names for new Intl.DateTimeFormat().resolvedOptions().timeZone
, which is then affecting the result of moment.tz.guess()
.
For example, if I set my computer's city and time zone to somewhere in India, calling the Intl
snippet above gives me:
- Firefox:
Asia/Kolkata
- Chrome:
Asia/Calcutta
- Safari:
Asia/Calcutta