Skip to content

Commit

Permalink
ICU-22407 Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankYFTang committed Jul 11, 2023
1 parent cc33596 commit 4872ab2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions icu4j/main/classes/core/src/com/ibm/icu/util/Calendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -6066,7 +6066,7 @@ protected int computeJulianDay() {
if (stamp[JULIAN_DAY] >= MINIMUM_USER_STAMP) {
int bestStamp = newestStamp(ERA, DAY_OF_WEEK_IN_MONTH, UNSET);
bestStamp = newestStamp(YEAR_WOY, EXTENDED_YEAR, bestStamp);
bestStamp = newestStamp(ORDINAL_MONTH, ORDINAL_MONTH, bestStamp);
// bestStamp = newestStamp(ORDINAL_MONTH, ORDINAL_MONTH, bestStamp);
if (bestStamp <= stamp[JULIAN_DAY]) {
return internalGet(JULIAN_DAY);
}
Expand Down Expand Up @@ -6619,7 +6619,7 @@ protected static final int floorDivide(long numerator, int denominator, int[] re
"DAY_OF_WEEK_IN_MONTH", "AM_PM", "HOUR", "HOUR_OF_DAY",
"MINUTE", "SECOND", "MILLISECOND", "ZONE_OFFSET",
"DST_OFFSET", "YEAR_WOY", "DOW_LOCAL", "EXTENDED_YEAR",
"JULIAN_DAY", "MILLISECONDS_IN_DAY",
"JULIAN_DAY", "MILLISECONDS_IN_DAY", "IS_LEAP_MONTH", "ORDINAL_MONTH"
};

/**
Expand Down
12 changes: 12 additions & 0 deletions icu4j/main/classes/core/src/com/ibm/icu/util/ChineseCalendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,18 @@ protected int internalGetMonth()
return month;
}

/**
* {@inheritDoc}
* @internal
*/
protected int internalGetMonth(int defaultValue)
{
if (resolveFields(MONTH_PRECEDENCE) == MONTH) {
return internalGet(MONTH, defaultValue);
}
return internalGetMonth();
}

/*
private static CalendarFactory factory;
public static CalendarFactory factory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ protected void handleComputeFields(int julianDay){
internalSet(ERA, 0);
internalSet(EXTENDED_YEAR, IndianYear);
internalSet(YEAR, IndianYear);
internalSet(ORDINAL_MONTH, IndianMonth);
internalSet(MONTH, IndianMonth);
internalSet(ORDINAL_MONTH, IndianMonth);
internalSet(DAY_OF_MONTH, IndianDayOfMonth );
internalSet(DAY_OF_YEAR, yday + 1); // yday is 0-based
}
Expand Down

0 comments on commit 4872ab2

Please sign in to comment.