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 easter date calculation : #326

Merged
merged 1 commit into from
Dec 3, 2023
Merged

Fix easter date calculation : #326

merged 1 commit into from
Dec 3, 2023

Conversation

rChassat
Copy link
Contributor

@rChassat rChassat commented Nov 20, 2023

  • Fix easter day calculation rounding for the lunar correction when not using calendar extension
  • added some phpunit test that checks cases that were incorrects before

The below code show what diff it makes for the lunar correction :

$year = 2025;
$lunar = (int) (((($year - 1400) / 100) * 8) / 25);
$lunarFixed = (int) (((int) (($year - 1400) / 100) * 8) / 25);
echo($lunar . "\n"); // output 2
echo($lunarFixed . "\n"); // output 1

In your tests, you have basically the same method in tests/Randomizer.php, with no important diff between the two expect the fix was already present in the test one, so I took it from it.

I rollbacked my changes from the issue on the end of the function, they weren't necessary.

- Easter day calculation rounding for the lunar correction when not using calendar extension
- added some phpunit test that checks cases that was incorrect before
@stelgenhof stelgenhof merged commit 404b641 into azuyalabs:develop Dec 3, 2023
23 of 24 checks passed
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.

None yet

2 participants