globalize icon indicating copy to clipboard operation
globalize copied to clipboard

Matching to close patterns in Globalize

Open cahuja opened this issue 8 years ago • 5 comments

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?

cahuja avatar Aug 31 '17 19:08 cahuja

Yeap, I read it the same way. Let's file UTS bug.

rxaviers avatar Aug 31 '17 19:08 rxaviers

Or is it an ICU bug?

rxaviers avatar Aug 31 '17 19:08 rxaviers

Perhaps @srl295 could shed some light...

rxaviers avatar Aug 31 '17 19:08 rxaviers

@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

srl295 avatar Aug 31 '17 20:08 srl295

Ok thanks @srl295

rxaviers avatar Aug 31 '17 20:08 rxaviers