javaandroidandroid-studioarabichijri

Did I make a mistake or is the HijrahDate Library buggy?


I have this code for my App, where I wanted a date like "06 Ramadan 1441" to show for 29.04.2020 but when I changed the date to 3.4.2021 and checked it with "https://www.islamicity.org/hijri-gregorian-converter/index.php?address=undefined#" it says 20.Shaban.1442 but my app says 21.Shaban.1442

String hij_date = HijrahDate.now().toString();
int date_len = hij_date.length();
String d = hij_date.substring(date_len - 2, date_len);
String m = hij_date.substring(date_len - 5, date_len - 3);
String y = hij_date.substring(date_len - 10, date_len - 6);
textView.setText(d + " " + monthname(m) + " " + y);
textView.setTypeface(null, Typeface.BOLD);

Thank you for your help.


Solution

  • I think the problem is not in the library. Hijra dates are not like regular dates, they are determined by moon and not the sun. And there is a debate on how date should be set. Some people started Ramandan on 24 April while others started on 25 April.