Skip to content

Commit

Permalink
Tachanun is not recited on Erev Rosh Hashana
Browse files Browse the repository at this point in the history
- Other Erev Yomim Tovim were already excluded. Thanks Shai!
- Tweak white space.
  • Loading branch information
KosherJava authored Aug 8, 2024
1 parent 6629a0f commit 0b6b95c
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions src/main/java/com/kosherjava/zmanim/hebrewcalendar/TefilaRules.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Zmanim Java API
* Copyright (C) 2019 - 2023 Eliyahu Hershfeld
* Copyright (C) 2019 - 2024 Eliyahu Hershfeld
* Copyright (C) 2019 - 2021 Y Paritcher
*
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
Expand Down Expand Up @@ -45,7 +45,7 @@
* System.out.println(hdf.format(jewishCalendar) + ": " + tr.isTachanunRecitedShacharis(jewishCalendar));</pre>
*
* @author &copy; Y. Paritcher 2019 - 2021
* @author &copy; Eliyahu Hershfeld 2019 - 2023
* @author &copy; Eliyahu Hershfeld 2019 - 2024
*
* @todo The following items may be added at a future date.
* <ol>
Expand Down Expand Up @@ -171,29 +171,29 @@ public boolean isTachanunRecitedShacharis(JewishCalendar jewishCalendar) {
int month = jewishCalendar.getJewishMonth();

if (jewishCalendar.getDayOfWeek() == Calendar.SATURDAY
|| (!tachanunRecitedSundays && jewishCalendar.getDayOfWeek() == Calendar.SUNDAY)
|| (!tachanunRecitedFridays && jewishCalendar.getDayOfWeek() == Calendar.FRIDAY)
|| (! tachanunRecitedSundays && jewishCalendar.getDayOfWeek() == Calendar.SUNDAY)
|| (! tachanunRecitedFridays && jewishCalendar.getDayOfWeek() == Calendar.FRIDAY)
|| month == JewishDate.NISSAN
|| (month == JewishDate.TISHREI && ((!tachanunRecitedEndOfTishrei && day > 8)
|| (month == JewishDate.TISHREI && ((! tachanunRecitedEndOfTishrei && day > 8)
|| (tachanunRecitedEndOfTishrei && (day > 8 && day < 22))))
|| (month == JewishDate.SIVAN && (tachanunRecitedWeekAfterShavuos && day < 7
|| !tachanunRecitedWeekAfterShavuos && day < (!jewishCalendar.getInIsrael()
&& !tachanunRecited13SivanOutOfIsrael ? 14: 13)))
|| (jewishCalendar.isYomTov() && (! jewishCalendar.isTaanis()
|| (!tachanunRecitedPesachSheni && holidayIndex == JewishCalendar.PESACH_SHENI))) // Erev YT is included in isYomTov()
|| (!jewishCalendar.getInIsrael() && !tachanunRecitedPesachSheni && !tachanunRecited15IyarOutOfIsrael
|| ! tachanunRecitedWeekAfterShavuos && day < (! jewishCalendar.getInIsrael()
&& ! tachanunRecited13SivanOutOfIsrael ? 14: 13)))
|| jewishCalendar.isErevYomTov() || (jewishCalendar.isYomTov() && (! jewishCalendar.isTaanis() //FIXME logic needs review for 15 shevat
|| (! tachanunRecitedPesachSheni && holidayIndex == JewishCalendar.PESACH_SHENI)))
|| (! jewishCalendar.getInIsrael() && ! tachanunRecitedPesachSheni && ! tachanunRecited15IyarOutOfIsrael
&& jewishCalendar.getJewishMonth() == JewishDate.IYAR && day == 15)
|| holidayIndex == JewishCalendar.TISHA_BEAV || jewishCalendar.isIsruChag()
|| jewishCalendar.isRoshChodesh()
|| (!tachanunRecitedShivasYemeiHamiluim &&
((!jewishCalendar.isJewishLeapYear() && month == JewishDate.ADAR)
|| (! tachanunRecitedShivasYemeiHamiluim &&
((! jewishCalendar.isJewishLeapYear() && month == JewishDate.ADAR)
|| (jewishCalendar.isJewishLeapYear() && month == JewishDate.ADAR_II)) && day > 22)
|| (!tachanunRecitedWeekOfPurim &&
((!jewishCalendar.isJewishLeapYear() && month == JewishDate.ADAR)
|| (! tachanunRecitedWeekOfPurim &&
((! jewishCalendar.isJewishLeapYear() && month == JewishDate.ADAR)
|| (jewishCalendar.isJewishLeapYear() && month == JewishDate.ADAR_II)) && day > 10 && day < 18)
|| (jewishCalendar.isUseModernHolidays()
&& (holidayIndex == JewishCalendar.YOM_HAATZMAUT || holidayIndex == JewishCalendar.YOM_YERUSHALAYIM))
|| (!tachanunRecitedWeekOfHod && month == JewishDate.IYAR && day > 13 && day < 21)) {
|| (! tachanunRecitedWeekOfHod && month == JewishDate.IYAR && day > 13 && day < 21)) {
return false;
}
return true;
Expand All @@ -210,7 +210,7 @@ public boolean isTachanunRecitedMincha(JewishCalendar jewishCalendar) {
JewishCalendar tomorrow = (JewishCalendar) jewishCalendar.clone();
tomorrow.forward(Calendar.DATE, 1);

if (!tachanunRecitedMinchaAllYear
if (! tachanunRecitedMinchaAllYear
|| jewishCalendar.getDayOfWeek() == Calendar.FRIDAY
|| ! isTachanunRecitedShacharis(jewishCalendar)
|| (! isTachanunRecitedShacharis(tomorrow) &&
Expand Down Expand Up @@ -243,7 +243,7 @@ public boolean isTachanunRecitedMincha(JewishCalendar jewishCalendar) {
public boolean isVeseinTalUmatarStartDate(JewishCalendar jewishCalendar) {
if (jewishCalendar.getInIsrael()) {
// The 7th Cheshvan can't occur on Shabbos, so always return true for 7 Cheshvan
return jewishCalendar.getJewishMonth() == JewishDate.CHESHVAN && jewishCalendar.getJewishDayOfMonth() == 7;
return jewishCalendar.getJewishMonth() == JewishDate.CHESHVAN && jewishCalendar.getJewishDayOfMonth() == 7;
} else {
if (jewishCalendar.getDayOfWeek() == Calendar.SATURDAY) { //Not recited on Friday night
return false;
Expand All @@ -254,7 +254,7 @@ public boolean isVeseinTalUmatarStartDate(JewishCalendar jewishCalendar) {
return jewishCalendar.getTekufasTishreiElapsedDays() == 47;
}
}
}
}

/**
* Returns true if tonight is the first night to start reciting <em>Vesein Tal Umatar Livracha</em> (
Expand All @@ -276,7 +276,7 @@ public boolean isVeseinTalUmatarStartDate(JewishCalendar jewishCalendar) {
public boolean isVeseinTalUmatarStartingTonight(JewishCalendar jewishCalendar) {
if (jewishCalendar.getInIsrael()) {
// The 7th Cheshvan can't occur on Shabbos, so always return true for 6 Cheshvan
return jewishCalendar.getJewishMonth() == JewishDate.CHESHVAN && jewishCalendar.getJewishDayOfMonth() == 6;
return jewishCalendar.getJewishMonth() == JewishDate.CHESHVAN && jewishCalendar.getJewishDayOfMonth() == 6;
} else {
if (jewishCalendar.getDayOfWeek() == Calendar.FRIDAY) { //Not recited on Friday night
return false;
Expand All @@ -287,7 +287,7 @@ public boolean isVeseinTalUmatarStartingTonight(JewishCalendar jewishCalendar) {
return jewishCalendar.getTekufasTishreiElapsedDays() == 46;
}
}
}
}

/**
* Returns if <em>Vesein Tal Umatar Livracha</em> (<em>Sheailas Geshamim</em>) is recited. This will return
Expand Down Expand Up @@ -323,7 +323,7 @@ public boolean isVeseinTalUmatarRecited(JewishCalendar jewishCalendar) {
* @see #isVeseinTalUmatarRecited(JewishCalendar)
*/
public boolean isVeseinBerachaRecited(JewishCalendar jewishCalendar) {
return !isVeseinTalUmatarRecited(jewishCalendar);
return ! isVeseinTalUmatarRecited(jewishCalendar);
}

/**
Expand Down Expand Up @@ -377,7 +377,7 @@ public boolean isMashivHaruachRecited(JewishCalendar jewishCalendar) {
* @return true if <em>Morid Hatal</em> (or the lack of reciting <em>Mashiv Haruach</em> following <em>nussach Ashkenaz</em>) is recited.
*/
public boolean isMoridHatalRecited(JewishCalendar jewishCalendar) {
return !isMashivHaruachRecited(jewishCalendar) || isMashivHaruachStartDate(jewishCalendar) || isMashivHaruachEndDate(jewishCalendar);
return ! isMashivHaruachRecited(jewishCalendar) || isMashivHaruachStartDate(jewishCalendar) || isMashivHaruachEndDate(jewishCalendar);
}

/**
Expand All @@ -403,23 +403,23 @@ public boolean isHallelRecited(JewishCalendar jewishCalendar) {
}
switch (month) {
case JewishDate.NISSAN:
if (day >= 15 && ((inIsrael && day <= 21) || (!inIsrael && day <= 22))){
if (day >= 15 && ((inIsrael && day <= 21) || (! inIsrael && day <= 22))){
return true;
}
break;
case JewishDate.IYAR: // modern holidays
if (jewishCalendar.isUseModernHolidays() && (holidayIndex == JewishCalendar.YOM_HAATZMAUT
if (jewishCalendar.isUseModernHolidays() && (holidayIndex == JewishCalendar.YOM_HAATZMAUT
|| holidayIndex == JewishCalendar.YOM_YERUSHALAYIM)){
return true;
}
break;
case JewishDate.SIVAN:
if (day == 6 || (!inIsrael && (day == 7))){
if (day == 6 || (! inIsrael && (day == 7))){
return true;
}
break;
case JewishDate.TISHREI:
if (day >= 15 && (day <= 22 || (!inIsrael && (day <= 23)))){
if (day >= 15 && (day <= 22 || (! inIsrael && (day <= 23)))){
return true;
}
}
Expand All @@ -440,7 +440,7 @@ public boolean isHallelShalemRecited(JewishCalendar jewishCalendar) {
boolean inIsrael = jewishCalendar.getInIsrael();
if (isHallelRecited(jewishCalendar)) {
if ((jewishCalendar.isRoshChodesh() && ! jewishCalendar.isChanukah())
|| (month == JewishDate.NISSAN && ((inIsrael && day > 15) || (!inIsrael && day > 16)))) {
|| (month == JewishDate.NISSAN && ((inIsrael && day > 15) || (! inIsrael && day > 16)))) {
return false;
} else {
return true;
Expand All @@ -459,7 +459,7 @@ public boolean isHallelShalemRecited(JewishCalendar jewishCalendar) {
* @see JewishCalendar#getIsMukafChoma()
*/
public boolean isAlHanissimRecited(JewishCalendar jewishCalendar) {
return jewishCalendar.isPurim() || jewishCalendar.isChanukah();
return jewishCalendar.isPurim() || jewishCalendar.isChanukah();
}

/**
Expand All @@ -477,14 +477,14 @@ public boolean isAlHanissimRecited(JewishCalendar jewishCalendar) {
* @see JewishCalendar#isRoshChodesh()
*/
public boolean isYaalehVeyavoRecited(JewishCalendar jewishCalendar) {
return jewishCalendar.isPesach() || jewishCalendar.isShavuos() ||jewishCalendar.isRoshHashana() || jewishCalendar.isYomKippur()
|| jewishCalendar.isSuccos() || jewishCalendar.isShminiAtzeres() || jewishCalendar.isSimchasTorah()
|| jewishCalendar.isRoshChodesh();
return jewishCalendar.isPesach() || jewishCalendar.isShavuos() ||jewishCalendar.isRoshHashana() || jewishCalendar.isYomKippur()
|| jewishCalendar.isSuccos() || jewishCalendar.isShminiAtzeres() || jewishCalendar.isSimchasTorah()
|| jewishCalendar.isRoshChodesh();
}

/**
* Returns if Is <em>Mizmor Lesoda</em> is recited on the day in question.
* @param jewishCalendar the Jewish calendar day.
* @param jewishCalendar the Jewish calendar day.
* @return if <em>Mizmor Lesoda</em> is recited.
*
* @see #isMizmorLesodaRecitedErevYomKippurAndPesach()
Expand All @@ -502,7 +502,7 @@ public boolean isMizmorLesodaRecited(JewishCalendar jewishCalendar) {
|| jewishCalendar.isCholHamoedPesach())) {
return false;
}
return true;
return true;
}

/**
Expand Down Expand Up @@ -668,7 +668,7 @@ public void setTachanunRecitedPesachSheni(boolean tachanunRecitedPesachSheni) {
* JewishCalendar#PESACH_SHENI <em>Pesach Sheni</em>}) out of Israel. If {@link #isTachanunRecitedPesachSheni()} is
* <code>true</code> this will be ignored even if <code>false</code>.
*
* @return if <em>tachanun</em> is set to be recited on 15 {@link JewishDate#IYAR <em>Iyar</em>} (<em>sfaika deyoma</em>
* @return if <em>tachanun</em> is set to be recited on 15 {@link JewishDate#IYAR <em>Iyar</em>} (<em>sfaika deyoma</em>
* of {@link JewishCalendar#PESACH_SHENI <em>Pesach Sheni</em>} out of Israel. If
* {@link #isTachanunRecitedPesachSheni()} is <code>true</code> this will be ignored even if <code>false</code>.
* @see #setTachanunRecited15IyarOutOfIsrael(boolean)
Expand All @@ -680,7 +680,7 @@ public boolean isTachanunRecited15IyarOutOfIsrael() {
}

/**
* Sets if <em>tachanun</em> should be recited on the 15th of {@link JewishDate#IYAR <em>Iyar</em>} (<a href=
* Sets if <em>tachanun</em> should be recited on the 15th of {@link JewishDate#IYAR <em>Iyar</em>} (<a href=
* "https://en.wikipedia.org/wiki/Yom_tov_sheni_shel_galuyot"><em>Yom Tov Sheni shel Galuyos</em></a> of
* {@link JewishCalendar#PESACH_SHENI <em>Pesach Sheni</em>}) out of Israel. Ignored if {@link
* #isTachanunRecitedPesachSheni()} is <code>true</code>.
Expand Down

0 comments on commit 0b6b95c

Please sign in to comment.