iansinnott / jstz

🌐Timezone detection for JavaScript
Other
175 stars 33 forks source link

fix problem with firefox returning Etc/ #12

Closed ferrolive closed 6 years ago

ferrolive commented 6 years ago

ignore Etc timezones coming from the internationalization api

iansinnott commented 6 years ago

Awesome, thanks @ferrolive. Can you provide a little more context on what was going on? What was the behavior before and what is it now?

ferrolive commented 6 years ago

Sure @iansinnott. Only Firefox the function was returning the Intl classEtc/GMT-X instead of Asia/XXXX IANA code . With the adjustment, it will return Asia/XXXX properly.

iansinnott commented 6 years ago

What is the ETC timezone?

I'd be happy to merge this in, I just don't want to break functionality for anyone else.

ferrolive commented 6 years ago

@iansinnott I think it's one of the IANA's time zone abbreviation format. Maybe you can have more details here ftp://ftp.iana.org/tz/data/etcetera. Normally, we expect jstz library to return always the "Continent/Zone" format (ex. America/New_York, Asia/Seoul). Somehow only Firefox does some crazy stuff with the Intl class that makes jstz return that format. It does not break the code for others.

iansinnott commented 6 years ago

OK, merged and published as 2.0, just in case this change breaks anything for existing users.