0

I want to convert the Gregorian calendar into Hijri calendar in Arabic letters. Could please guide me?

void HijriCalender() {
    UmmalquraCalendar now = new UmmalquraCalendar();

    HijriDatePickerDialog dpd = HijriDatePickerDialog.newInstance(
        Volunteer.this,
        now.get(UmmalquraCalendar.YEAR),
        now.get(UmmalquraCalendar.MONTH),
        now.get(UmmalquraCalendar.DAY_OF_MONTH)
    );

    locale = new Locale("ar", "AE");

    dpd.setLocale(locale);
    dpd.show(getFragmentManager(), "HijriDatePickerDialog");
}

enter image description here

This is My Current output

Mehdi Dehghani
  • 10,970
  • 6
  • 59
  • 64
  • 1
    You can use Joda Time. Please refer to this link https://stackoverflow.com/questions/15728744/converting-gregorian-to-hijri-date – coroutineDispatcher Apr 12 '19 at 06:47
  • @StavroXhardha No, Joda Time is unusable because it does not contain the umalqura calendar (which the OP obviously talks about). The same with ThreetenBP. – Meno Hochschild Apr 12 '19 at 14:12
  • Hmm habibi , have you ever came across this ? You could use it and build your own data there . https://aladhan.com/islamic-calendar-api – coroutineDispatcher Apr 12 '19 at 14:14
  • @StavroXhardha The website you cites seems to use a hijri converter from layth a. ibraheem. And this man seems to use an algorithmic version so it is not the umalqura calendar again. Anyway, the question of the OP is rather about formatting. – Meno Hochschild Apr 12 '19 at 14:48
  • Can you please tell us where do you get the class "HijriDatePickerDialog" from? I think its API has to offer any access to styling / formatting. If not then you have to design your own date picker or use another one. – Meno Hochschild Apr 12 '19 at 14:51

0 Answers0