ICU-2424 limit fixes

X-SVN-Rev: 14012
This commit is contained in:
Steven R. Loomis 2003-12-04 23:18:15 +00:00
parent f67d795773
commit 3031d44d3c
2 changed files with 16 additions and 2 deletions

View File

@ -189,9 +189,9 @@ static const int32_t LIMITS[UCAL_FIELD_COUNT][4] = {
{/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // MILLISECOND
{/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // ZONE_OFFSET
{/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // DST_OFFSET
{ -5000001, -5000001, 5000001, 5000001 }, // YEAR_WOY
{ 1, 1, 5000001, 5000001 }, // YEAR_WOY
{/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // DOW_LOCAL
{ -5000000, -5000000, 5000000, 5000000 }, // EXTENDED_YEAR
{ 1, 1, 5000000, 5000000 }, // EXTENDED_YEAR
{/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // JULIAN_DAY
{/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1} // MILLISECONDS_IN_DAY
};

View File

@ -511,6 +511,20 @@ int32_t JapaneseCalendar::handleGetLimit(UCalendarDateFields field, ELimitType l
case UCAL_ERA:
return gJapanCalendarLimits[field][limitType];
case UCAL_EXTENDED_YEAR: // extended year limits
switch(limitType) {
case UCAL_LIMIT_GREATEST_MINIMUM:
case UCAL_LIMIT_MINIMUM:
return kEraInfo[0].year; /* minimum is 1st era year */
case UCAL_LIMIT_LEAST_MAXIMUM:
case UCAL_LIMIT_MAXIMUM:
/* use Gregorian calendar max */
default:
return GregorianCalendar::handleGetLimit(field,limitType);
}
break;
default:
return GregorianCalendar::handleGetLimit(field,limitType);
}