msarhan / ummalqura-calendar

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

com.github.msarhan.ummalqura.calendar.DateTimeException: Invalid Hijrah day of month: 30 #28

Closed LPC351710 closed 3 years ago

LPC351710 commented 3 years ago
     UmmalquraCalendar tempWorkingCalendar = new UmmalquraCalendar();
    tempWorkingCalendar.set(1442, 6, 30);
    String displayM = tempWorkingCalendar.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.ENGLISH)
            + " " + tempWorkingCalendar.get(Calendar.DAY_OF_MONTH) + ", " + tempWorkingCalendar.get(Calendar.MONTH) + ", " + month.getYear();

com.github.msarhan.ummalqura.calendar.DateTimeException: Invalid Hijrah day of month: 30 at com.github.msarhan.ummalqura.calendar.HijrahChronology.getEpochDay(HijrahChronology.java:255) at com.github.msarhan.ummalqura.calendar.HijrahChronology.toGregorian(HijrahChronology.java:697) at com.github.msarhan.ummalqura.calendar.UmmalquraCalendar.set(UmmalquraCalendar.java:250) at java.util.Calendar.set(Calendar.java:1227)

LPC351710 commented 3 years ago

It says Invalid Hijrah day of month: 30 but month 7 does have 30 days!

LPC351710 commented 3 years ago

I found the problem, in the hijrah-config.properties file 1442=29 30 29 30 29 30 29 30 30 29 30 29

Sabboo commented 3 years ago

Related to #26

msarhan commented 3 years ago

Duplicate of #26