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.
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.
+1
+1
+1
+1. please fix it
+1
+1
+1
+1
This has been fixed in [email protected].
I'm using [email protected] but I still get that error log, is there something I could do?
I am also getting the error using 0.5.5
@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.
@mj1856 yeah I've solved that, I don't remember how though :) Probably I was importing the wrong package without the tz data
Most helpful comment
This has been fixed in
[email protected].