azuyalabs / yasumi

The easy PHP Library for calculating holidays
https://www.yasumi.dev
Other
1.04k stars 152 forks source link

Fix easter date calculation : #326

Closed rChassat closed 10 months ago

rChassat commented 10 months ago

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.