globalizejs / globalizejs/globalize

Matching to close patterns in Globalize

Open
#773 5 comments 0 reactions 0 assignees View on GitHub
uts-35-bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.