globalizejs / globalizejs/globalize
Matching to close patterns in Globalize
- Dominant language
- JavaScript
- Stars
- 4.8k
- Forks
- 585
- PR merge metrics
- No merged PRs in 30d
Description
Matching to close patterns has different behavior in ICU4j and Globalize and here is an example of the difference.
Consider the pattern "yyMD" in locale "en-SG"
As per CLDR data, the following pattern exists -
> "yMd" -> "dd/MM/y"
Now, when this same pattern (yMd) is run through Globalize and ICU4j, we get the expected result which is "dd/MM/y"
However, when I pass the pattern (yyMd) though Globalize and ICU4j, the results differ -
Globalize (yyMd) -> dd/MM/yy
ICU4j (yyMd) -> d/M/yy
When I read TR-35, I see that the notion of distance between y and yy would apply in a similar manner to how it would apply for MMM and MMMM as given in the example. In this case, I believe Globalize should be correct, but I would like another opinion before being sure to mark this as a spec bug.
Thoughts @rxaviers?
Contributor guide
Assessment
This issue has not been assessed yet.