Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] correction skips a day when the Hijri month ends on 29th #22

Merged
merged 2 commits into from
Apr 3, 2022

Conversation

Socotoly
Copy link
Contributor

@Socotoly Socotoly commented Apr 3, 2022

This PR fixes #21


Before this fix:

correction = 1

$Arabic = new \ArPHP\I18N\Arabic();
$g_date = strtotime("2022-04-02");
$hijri = $Arabic->date('j F', $g_date, 1);

output: "30 شعبان"


correction = 2

$Arabic = new \ArPHP\I18N\Arabic();
$g_date = strtotime("2022-04-02");
$hijri = $Arabic->date('j F', $g_date, 2);

output: "2 رمضان"

With this fix:

correction = 1

$Arabic = new \ArPHP\I18N\Arabic();
$g_date = strtotime("2022-04-02");
$hijri = $Arabic->date('j F', $g_date, 1);

output: "30 شعبان"


correction = 2

$Arabic = new \ArPHP\I18N\Arabic();
$g_date = strtotime("2022-04-02");
$hijri = $Arabic->date('j F', $g_date, 2);

output: "1 رمضان"

@khaled-alshamaa khaled-alshamaa merged commit 63c5a40 into khaled-alshamaa:master Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hijri date correction not behaving consistently when the Hijri month end on 29th
2 participants