KosherJava / zmanim

KosherJava Zmanim API / Library
https://kosherjava.com
GNU Lesser General Public License v2.1
107 stars 49 forks source link

Add Mizmor Lesoda to TefilaRules #218

Closed CompuGenius-Programs closed 1 year ago

CompuGenius-Programs commented 1 year ago

In TefilaRules, you have Mizmor Lesoda under a TODO. I need it now, so I implemented it like below.

public boolean isMizmorLesodaRecited(JewishCalendar jewishCalendar) {
    int holidayIndex = jewishCalendar.getYomTovIndex();
    return holidayIndex != JewishCalendar.EREV_YOM_KIPPUR && holidayIndex != JewishCalendar.EREV_PESACH && !jewishCalendar.isCholHamoedPesach();
}
zachweix commented 1 year ago

Should it also check that it isn't Shabbos or Yom Tov?

CompuGenius-Programs commented 1 year ago

Should it also check that it isn't Shabbos or Yom Tov?

I suppose, but I don't see a use-case for checking isMizmorLesodaRecited except in a weekday Siddur - I don't think shul screens or the like would be displaying it if it's said. Up to @KosherJava if he thinks it should check for that or not.

zachweix commented 1 year ago

I hear, but it doesn't really cost too much extra in the method. With that said, I've seen shul boards say on shabbos "no tachanun", so it is theoretically possible (?)

KosherJava commented 1 year ago

@CompuGenius and @zachweix, Even if not used, it should not return true for Shabbos since it is incorrect. I will hopefully add this sometime this week.

CompuGenius-Programs commented 1 year ago

@CompuGenius and @zachweix, Even if not used, it should not return true for Shabbos since it is incorrect. I will hopefully add this sometime this week.

That's true. Alright, awesome 👍 Thanks for the shout-out in the changelogs of 2.5.0 btw, was a pleasant surprise when I happened to check it today 😊

KosherJava commented 1 year ago

Adding a check for isAssurBemelacha() should do the trick. Something like:

return ! JewishCalendar.isAssurBemelacha() && holidayIndex != JewishCalendar.EREV_YOM_KIPPUR
          && holidayIndex != JewishCalendar.EREV_PESACH && ! jewishCalendar.isCholHamoedPesach();
KosherJava commented 1 year ago

There seems to be some differences between Ashkenazi and Sephardi minhagim for Mizmor Lesoda. Nothing is ever simple.

CompuGenius-Programs commented 1 year ago

There seems to be some differences between Ashkenazi and Sephardi minhagim for Mizmor Lesoda. Nothing is ever simple.

Oh boy haha. Do you already have a check for Sefardik minhagim? I'm sure there are differences of opinions on other checks you have implemented, no?

Elyahu41 commented 1 year ago

@KosherJava TefilaRules doesn't even have a boolean to check for sephardic minhagim/halacha. If you want to include those minhagim, there should be a boolean or separate method. Don't even get me started with tachanun 😄

KosherJava commented 1 year ago

@Elyahu41, There are no cases to date in TefilaRules that have different Ashkenazi vs Sephardi minhagim. Tachanun rules are so varied that it is not a factor there, and there are multiple settings already to handle that. As far as I can tell this is the first, and my preference would be not to make a general Sephardi vs Ashkenazi setting because even among the Sephardim and Ashkenazim I can envision differences that would not fit in one boolean. I will probably create something like isUseSephardiMizmorLesodaRules() or something like isMizmorLesodaRecitedErevYomKippurAndPesach() .