msarhan / ummalqura-calendar

Implementation of java.util.Calendar for the Umm Al-Qura calendar system.
MIT License
154 stars 51 forks source link

DateTimeException Invalid Hijrah day of month: 30 #31

Closed mhelmi closed 2 years ago

mhelmi commented 2 years ago

Caused by com.github.msarhan.ummalqura.calendar.DateTimeException Invalid Hijrah day of month: 30 com.github.msarhan.ummalqura.calendar.HijrahChronology.getEpochDay (HijrahChronology.java:255) com.github.msarhan.ummalqura.calendar.HijrahChronology.toGregorian (HijrahChronology.java:697) com.github.msarhan.ummalqura.calendar.UmmalquraCalendar.set (UmmalquraCalendar.java:250) com.github.msarhan.ummalqura.calendar.UmmalquraCalendar. (UmmalquraCalendar.java:193) com.github.msarhan.ummalqura.calendar.UmmalquraCalendar. (UmmalquraCalendar.java:155)

this happened at (30/11/1442)

bassil-altamimi commented 2 years ago

same issue

mhelmi commented 2 years ago

To reproduce this bug change the mobile date to 30 Dhu'l-Qi'dah 1442 and set the default value from calendar

new UmmalquraCalendar(1500, UmmalquraCalendar.THUL_QIDAH, 30);

msarhan commented 2 years ago

This is a duplicate of #26 which is solved in 2.0.2 version.

mhelmi commented 2 years ago

This is a duplicate of #26 which is solved in 2.0.2 version.

Actually, it's not solved for me in 2.0.2 version.

msarhan commented 2 years ago

I've run your sample code above and it it's working fine.

Please to check this test case and make changes to use 1442-11-30 to make sure it is working: https://github.com/msarhan/ummalqura-calendar/blob/fc1c70bfbd29dc28638ae123bf2a02f3ff05230d/src/test/java/com/github/msarhan/ummalqura/calendar/HijrahChronologyTest.java#L100-L106

If you still get the same error, please to submit a test case to reproduce the issue.