]> granicus.if.org Git - icu/commit
ICU-21283 Fix Java for calendar bugs
authorFrank Tang <ftang@chromium.org>
Thu, 17 Sep 2020 03:22:51 +0000 (20:22 -0700)
committerFrank Yung-Fong Tang <41213225+FrankYFTang@users.noreply.github.com>
Thu, 17 Sep 2020 19:20:47 +0000 (12:20 -0700)
commit5769803253f73be7a9af3d598fad7ee16fef929e
treea0059853b529fb147488dced0ac04e0eded0ef77
parent4583c1e77cba4d62dc5a538bead88bd48c5ad493
ICU-21283 Fix Java for calendar bugs

This is the java port of ICU-21043 (for C++)
This PR fixes
ICU-21043 Erroneous date display in indian calendar of all dates prior to 0001-01-01.
ICU-21044 Hebrew Calendar calculation is incorrect when the year < 1
ICU-21045 Erroneous date display in islamic and islamic-rgsa calendars of all dates prior to 0622-07-18.
ICU-21046 Erroneous date display in islamic-umalqura calendar of all dates prior to -195366-07-23.

The problem in the IndianCalendarl is
ICU-21043 the gregorian/julain convesion is wrong. Swith to use the
calculation function in the Calendar class.

The problem in the HebrewCalendar is
ICU-21044 the use of bulit in / is wrong when the year or month could be < 1.

The problem in the IslamicCalendar is

ICU-21045: The math of % negative number for year and month is wrong.
Also add tests to exhaust test 8000 years for all calendar. In quick
mode, only test 2.5 years.

reduce the number of date in quick mode
icu4j/main/classes/core/src/com/ibm/icu/util/IndianCalendar.java
icu4j/main/classes/core/src/com/ibm/icu/util/IslamicCalendar.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java