GeniusTS / hijri-dates

PHP library to convert Gregorian date to Hijri date and vice versa
MIT License
100 stars 37 forks source link

Hijri Date is not correct #15

Closed AmirAmin closed 3 years ago

AmirAmin commented 5 years ago

Hello,

The Hijri Date is not correct, For ex. It is showing that Ramadan has started yesterday (May 5th).

Although it is either today (May 6th) or tomorrow (May 7th).

Best Regards,

AmirAmin commented 5 years ago

I have fixed it using:

\GeniusTS\HijriDate\Hijri::setDefaultAdjustment(-1);

But I am not sure if it is the correct solution or not.

AmirAmin commented 5 years ago

I have fixed it using:

\GeniusTS\HijriDate\Hijri::setDefaultAdjustment(-1);

But I am not sure if it is the correct solution or not.

It will fix the upcoming, and set the old dates wrong.

aboudeh87 commented 4 years ago

I have fixed it using: \GeniusTS\HijriDate\Hijri::setDefaultAdjustment(-1); But I am not sure if it is the correct solution or not.

It will fix the upcoming, and set the old dates wrong.

Yes because this function set the default adjustment for all dates, use the second parameter of convertToHijria method Eg.:Hijri :: convertToHijri ($date, -1)`