msarhan / ummalqura-calendar

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

Question for local manual correction plus or minus one day #6

Closed jinbatsu closed 6 years ago

jinbatsu commented 8 years ago

How to implement this for manual correction plus or minus one day. Example during 1 Ramadhan, 1 Idul Fitr and 1 Idul Adha. Any suggestion for doing this?

Thank You

Naheel-Azawy commented 8 years ago

In UmmalquraGregorianConverter class,

public static int[] toHijri(Date date) {
        Calendar gCal = Calendar.getInstance();
        gCal.setTime(date);
                // do your stuff here
        gCal.add(Calendar.DAY_OF_MONTH, yourCorrection);