Skip to content

Commit

Permalink
ICU-22202 Extended the code to do the right thing for all the valid "…
Browse files Browse the repository at this point in the history
…year" characters.
  • Loading branch information
richgillam committed Mar 13, 2024
1 parent 5625803 commit 39ecbf8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2314,8 +2314,8 @@ private static boolean fieldExistsInSkeleton(int field, String skeleton)
// if the caller specified Calendar.MONTH, check the pattern for both M and L
result = skeleton.contains("L");
} else if (fieldChar.equals("y")) {
// if the caller specified Calendar.YEAR, check the pattern for both y and U
result = skeleton.contains("U");
// if the caller specified Calendar.YEAR, check the pattern for y, Y, u, U, and r
result = skeleton.contains("U") || skeleton.contains("Y") || skeleton.contains("u") || skeleton.contains("r");
}
}
return result;
Expand Down

0 comments on commit 39ecbf8

Please sign in to comment.