I am trying to parse below date in java using normal, hijri and Ummalqura calenders but everytime getting the same exception as below
Date: "30-02-1405" or "30-12-1419"
DateTimeException: Invalid Hijrah day of month: 30
Note: There are many other date which are causing the same issue.
To me, it seems like i am not able to pass the calendar type correctly to the calender function. Can anyone help me parsing these dates.
Below are the code i tried
// Using the msarhan ummalqura-calendar library
Locale en = Locale.ENGLISH;
UmmalquraCalendar calnow = new UmmalquraCalendar(en);
calnow.set(1419, UmmalquraCalendar.THUL_HIJJAH, 30);
System.out.println(calnow.getTime());
// Using Java time HijrahChronology
HijrahDate dateOfBirthHijri = HijrahChronology.INSTANCE.date(1405, 2, 30);
THUL_HIJJAH(December) (year 1419) andSAFAR(February) (year 1405) has only 29 days .So, the dates: "30-02-1405", "30-12-1419" are invalid. Use 29th day instead.
Update to this:
Or
Output: