• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1diff --git a/source/i18n/calendar.cpp b/source/i18n/calendar.cpp
2index 72d5d10ed..d87a9baf0 100644
3--- a/source/i18n/calendar.cpp
4+++ b/source/i18n/calendar.cpp
5@@ -654,7 +654,7 @@ static const int32_t kCalendarLimits[UCAL_FIELD_COUNT][4] = {
6     {           0,            0,            59,            59  }, // MINUTE
7     {           0,            0,            59,            59  }, // SECOND
8     {           0,            0,           999,           999  }, // MILLISECOND
9-    {-16*kOneHour, -16*kOneHour,   12*kOneHour,   30*kOneHour  }, // ZONE_OFFSET
10+    {-24*kOneHour, -16*kOneHour,   12*kOneHour,   30*kOneHour  }, // ZONE_OFFSET
11     { -1*kOneHour,  -1*kOneHour,    2*kOneHour,    2*kOneHour  }, // DST_OFFSET
12     {/*N/A*/-1,       /*N/A*/-1,     /*N/A*/-1,       /*N/A*/-1}, // YEAR_WOY
13     {           1,            1,             7,             7  }, // DOW_LOCAL
14diff --git a/source/test/intltest/tztest.cpp b/source/test/intltest/tztest.cpp
15index 14f072f3c..7aa60bb1f 100644
16--- a/source/test/intltest/tztest.cpp
17+++ b/source/test/intltest/tztest.cpp
18@@ -2623,4 +2623,13 @@ void TimeZoneTest::TestRawOffsetAndOffsetConsistency22041() {
19                      zone->getRawOffset(), raw);
20     }
21 }
22+
23+void TimeZoneTest::TestGMTMinus24ICU22526() {
24+    UErrorCode status = U_ZERO_ERROR;
25+    LocalPointer<TimeZone> tz(TimeZone::createTimeZone("GMT-23:59"), status);
26+    U_ASSERT(U_SUCCESS(status));
27+    GregorianCalendar gc(tz.orphan(), status);
28+    gc.setTime(123456789, status);
29+    gc.get(UCAL_MONTH, status);
30+}
31 #endif /* #if !UCONFIG_NO_FORMATTING */
32diff --git a/source/test/intltest/tztest.h b/source/test/intltest/tztest.h
33index 6dcdbd3f6..68a843c92 100644
34--- a/source/test/intltest/tztest.h
35+++ b/source/test/intltest/tztest.h
36@@ -105,6 +105,7 @@ public:
37     void TestGetIDForWindowsID();
38     void TestCasablancaNameAndOffset22041();
39     void TestRawOffsetAndOffsetConsistency22041();
40+    void TestGMTMinus24ICU22526();
41
42     static const UDate INTERVAL;
43
44