From 3031d44d3c8a0f3ff528a8d2066355641777a952 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 4 Dec 2003 23:18:15 +0000 Subject: [PATCH] ICU-2424 limit fixes X-SVN-Rev: 14012 --- icu4c/source/i18n/islamcal.cpp | 4 ++-- icu4c/source/i18n/japancal.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/icu4c/source/i18n/islamcal.cpp b/icu4c/source/i18n/islamcal.cpp index 1f02e4705a..d59a498e89 100644 --- a/icu4c/source/i18n/islamcal.cpp +++ b/icu4c/source/i18n/islamcal.cpp @@ -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 }; diff --git a/icu4c/source/i18n/japancal.cpp b/icu4c/source/i18n/japancal.cpp index 47e14e76a0..3a7f5f3d8f 100644 --- a/icu4c/source/i18n/japancal.cpp +++ b/icu4c/source/i18n/japancal.cpp @@ -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); }