zman-org / zman

:calendar: A Jewish date converter and helper.
https://github.com/zman-org/zmanim.github.io/blob/dev/src/docs/index.md
MIT License
17 stars 6 forks source link

Wrong Parsha next week #35

Open yskraus opened 2 months ago

yskraus commented 2 months ago

echo Zman::parse('2024-09-01')->parsha;

Output

   Ki Seitzei
yskraus commented 2 months ago

I think issue is in Getters/Parsha.php:135

I changed to $offset += $shabbos > (!$this->isJewishLeapYear() ? 46 : 49) ? 1 : 0; but im not sure its good

Shrage-Oberlander commented 2 months ago

Next Week is "Shoiftim", Then "Ki Seietzai", Then "Ki Tzuvoi", Then "Nitzuvim Vayeilech" on zman its like this. Next Week "Ki Seietzai", Then "Ki Tzuvoi", Then "Nitzuvim" Then "Nitzuvim Vayeilech"

zachweix commented 2 months ago

I have worked on this project in the past, but you can check my more recent work at https://github.com/zachweix/PhpZmanim. I admit that I need to update the documentation, but if you are using a new enough version of the library you can get a date (make sure it's Shabbos, during the week it will return nothing) and get the parsha.

yskraus commented 2 months ago

I think issue is in Getters/Parsha.php:135

I changed to $offset += $shabbos > (!$this->isJewishLeapYear() ? 46 : 49) ? 1 : 0; but im not sure its good

this solution is not working for next year

yskraus commented 2 months ago

I see now that the issue is with the offset after Vayakheil like its mention in https://github.com/zman-org/zman/issues/33

pintend commented 2 months ago

I think issue is in Getters/Parsha.php:135 I changed to $offset += $shabbos > (!$this->isJewishLeapYear() ? 46 : 49) ? 1 : 0; but im not sure its good

this solution is not working for next year

which date broke after this fix? 2025 Sep looks correct

Im trying to get a failing test if this line of code is removed. (when i remove the line it seems to work and no existing tests fail) what case is this offset solving?

the next 3 weeks are broken 9/7/2024, 9/14/2024, 9/21/2024 basically until Nitzavim