Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intl API timezone guessing logs an error in a valid case #324

Closed
jaccus opened this issue Mar 29, 2016 · 14 comments
Closed

Intl API timezone guessing logs an error in a valid case #324

jaccus opened this issue Mar 29, 2016 · 14 comments
Labels

Comments

@jaccus
Copy link

jaccus commented Mar 29, 2016

Currently the rebuildGuess function logs an error when Intl API guessing did not succeed:
logError("Moment Timezone found " + intlName + " from the Intl api, but did not have that data loaded.");

It is however a valid case when Intl API returns an undefined value, see note in ECMA Standard:

In this version of the ECMAScript Internationalization API, the timeZone property will remain undefined if no timeZone property was provided in the options object provided to the Intl.DateTimeFormat constructor.

rebuildGuess function should most likely be fixed not to treat undefined value from Intl API as error, but instead let the function continue with the non-Intl execution.

@mattjohnsonpint
Copy link
Contributor

Correct. undefined means the browser implements the API functions itself, but doesn't have time zone data to return.

Note that this was because in 1.0 of the Intl spec, time zone support was considered optional. In the current 2.0 version, it's mandatory. So undefined should only be coming from implementations that haven't yet caught up to 2.0.

@arjunasuresh3
Copy link

+1

2 similar comments
@BenjaminBrandmeier
Copy link

+1

@lvornholt
Copy link

+1

@jgoldhammer
Copy link

+1. please fix it

@flox1an
Copy link

flox1an commented Apr 22, 2016

+1

3 similar comments
@hamroune
Copy link

+1

@gidsi
Copy link

gidsi commented Apr 25, 2016

+1

@ewagstaff
Copy link

+1

@timrwood
Copy link
Member

timrwood commented May 3, 2016

This has been fixed in [email protected].

@timrwood timrwood closed this as completed May 3, 2016
@alex88
Copy link

alex88 commented Aug 25, 2016

I'm using [email protected] but I still get that error log, is there something I could do?

@sagarguhe
Copy link

I am also getting the error using 0.5.5

@mattjohnsonpint
Copy link
Contributor

@alex88 @sagarguhe - Sorry, didn't see this earlier. I think maybe you actually don't have the data loaded? If not, please let me know specifically which browser and OS this is occurring on please. Also, a JSFiddle would be useful.

@alex88
Copy link

alex88 commented Oct 26, 2016

@mj1856 yeah I've solved that, I don't remember how though :) Probably I was importing the wrong package without the tz data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests