-
Notifications
You must be signed in to change notification settings - Fork 602
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
Globalize-runtime cannot have two unit formatters with same options but different number formatters #704
Comments
#705 is related and may have the same solution |
nkovacs
added a commit
to nkovacs/globalize
that referenced
this issue
May 11, 2017
JSON.stringify omits functions, so the generated runtimeKey did not depend on the value of the numberFormatter option, causing different unitFormatters to have an identical runtimeKey. Fixes globalizejs#704
nkovacs
added a commit
to nkovacs/globalize
that referenced
this issue
May 11, 2017
JSON.stringify omits functions, so the generated runtimeKey did not depend on the value of the numberFormatter option, causing different unitFormatters to have an identical runtimeKey. Fixes globalizejs#704
nkovacs
added a commit
to nkovacs/globalize-compiler
that referenced
this issue
May 11, 2017
This is needed to fix globalizejs/globalize#704
nkovacs
added a commit
to nkovacs/globalize
that referenced
this issue
May 11, 2017
JSON.stringify omits functions, so the generated runtimeKey did not depend on the value of the numberFormatter option, causing different unitFormatters to have an identical runtimeKey. Fixes globalizejs#704
nkovacs
added a commit
to nkovacs/globalize-compiler
that referenced
this issue
May 11, 2017
This is needed to fix globalizejs/globalize#704
nkovacs
added a commit
to nkovacs/globalize
that referenced
this issue
May 22, 2017
JSON.stringify omits functions, so the generated runtimeKey did not depend on the value of the numberFormatter option, causing different unitFormatters to have an identical runtimeKey. Fixes globalizejs#704
rxaviers
added a commit
that referenced
this issue
Jul 13, 2018
rxaviers
added a commit
that referenced
this issue
Jul 13, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Globalize version: 1.2.3
Globalize compiler version: v0.2.4
Example code (might not compile, but hopefully illustrates the point):
Expected:
x == "3"
andy== "03"
Actual:
x == "3"
andy == "3"
The problem is that the unit formatter takes a number formatter (a function) as one of its options, but the runtime keys are generated by
JSON.stringifying
the options (see here), and JSON.stringify stringifies functions as empty string.So, the runtime key is resolved to the same thing in both formatters, even though they have different number formatters.
The text was updated successfully, but these errors were encountered: