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

formatMessage does not format when parameter is 0 #547

Closed
NielsFestjens opened this issue Feb 26, 2015 · 0 comments
Closed

formatMessage does not format when parameter is 0 #547

NielsFestjens opened this issue Feb 26, 2015 · 0 comments
Labels
Milestone

Comments

@NielsFestjens
Copy link

In the formatMessage function:
var replacements = unwrap(params) || []; (should be around line 451)
when params is 0 (for example, when minimum value is 0), you end up with an empty array, so you get the message 'Please enter a value greater than or equal to {0}'.
I fixed this by replacing the code with

var replacements = unwrap(params);
if (replacements === undefined) {
    replacements = [];
}

demo of the problem: http://jsfiddle.net/a1ou4tsf/ (this is the official demo, but with age minimum set to 0 and value set to -5). Press submit to see the result

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

2 participants