Matching to close patterns in Globalize
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?
Yeap, I read it the same way. Let's file UTS bug.
Or is it an ICU bug?
Perhaps @srl295 could shed some light...
@rxaviers it's a great question, can you send a note to cldr-users? I can confirm as with the links below:
icu4j yMd@en-SG dd/MM/y
icu4j yyMd@en-SG d/M/yy
Ok thanks @srl295