moment-timezone icon indicating copy to clipboard operation
moment-timezone copied to clipboard

Needs the updated zone names

Open AshwinTayson opened this issue 4 years ago • 7 comments

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.

AshwinTayson avatar Nov 25 '20 11:11 AshwinTayson

Asia/Calcutta is deprecated as Calcutta was old name of Kolkata

iamareebjamal avatar Dec 05 '20 13:12 iamareebjamal

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

AshwinTayson avatar Dec 05 '20 15:12 AshwinTayson

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

iamareebjamal avatar Dec 05 '20 15:12 iamareebjamal

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

AshwinTayson avatar Dec 05 '20 16:12 AshwinTayson

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

iamareebjamal avatar Dec 05 '20 16:12 iamareebjamal

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?

AshwinTayson avatar Dec 05 '20 16:12 AshwinTayson

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

iamareebjamal avatar Dec 05 '20 16:12 iamareebjamal

@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.

ichernev avatar Aug 25 '22 15:08 ichernev

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?

MayukhC99 avatar Sep 22 '22 12:09 MayukhC99

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

gilmoreorless avatar Sep 26 '22 12:09 gilmoreorless