1
1
/*
2
2
* Zmanim Java API
3
- * Copyright (C) 2019 - 2023 Eliyahu Hershfeld
3
+ * Copyright (C) 2019 - 2024 Eliyahu Hershfeld
4
4
* Copyright (C) 2019 - 2021 Y Paritcher
5
5
*
6
6
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
45
45
* System.out.println(hdf.format(jewishCalendar) + ": " + tr.isTachanunRecitedShacharis(jewishCalendar));</pre>
46
46
*
47
47
* @author © Y. Paritcher 2019 - 2021
48
- * @author © Eliyahu Hershfeld 2019 - 2023
48
+ * @author © Eliyahu Hershfeld 2019 - 2024
49
49
*
50
50
* @todo The following items may be added at a future date.
51
51
* <ol>
@@ -171,29 +171,29 @@ public boolean isTachanunRecitedShacharis(JewishCalendar jewishCalendar) {
171
171
int month = jewishCalendar .getJewishMonth ();
172
172
173
173
if (jewishCalendar .getDayOfWeek () == Calendar .SATURDAY
174
- || (!tachanunRecitedSundays && jewishCalendar .getDayOfWeek () == Calendar .SUNDAY )
175
- || (!tachanunRecitedFridays && jewishCalendar .getDayOfWeek () == Calendar .FRIDAY )
174
+ || (! tachanunRecitedSundays && jewishCalendar .getDayOfWeek () == Calendar .SUNDAY )
175
+ || (! tachanunRecitedFridays && jewishCalendar .getDayOfWeek () == Calendar .FRIDAY )
176
176
|| month == JewishDate .NISSAN
177
- || (month == JewishDate .TISHREI && ((!tachanunRecitedEndOfTishrei && day > 8 )
177
+ || (month == JewishDate .TISHREI && ((! tachanunRecitedEndOfTishrei && day > 8 )
178
178
|| (tachanunRecitedEndOfTishrei && (day > 8 && day < 22 ))))
179
179
|| (month == JewishDate .SIVAN && (tachanunRecitedWeekAfterShavuos && day < 7
180
- || !tachanunRecitedWeekAfterShavuos && day < (!jewishCalendar .getInIsrael ()
181
- && !tachanunRecited13SivanOutOfIsrael ? 14 : 13 )))
182
- || ( jewishCalendar .isYomTov () && (! jewishCalendar .isTaanis ()
183
- || (!tachanunRecitedPesachSheni && holidayIndex == JewishCalendar .PESACH_SHENI ))) // Erev YT is included in isYomTov( )
184
- || (!jewishCalendar .getInIsrael () && !tachanunRecitedPesachSheni && !tachanunRecited15IyarOutOfIsrael
180
+ || ! tachanunRecitedWeekAfterShavuos && day < (! jewishCalendar .getInIsrael ()
181
+ && ! tachanunRecited13SivanOutOfIsrael ? 14 : 13 )))
182
+ || jewishCalendar . isErevYomTov () || ( jewishCalendar .isYomTov () && (! jewishCalendar .isTaanis () //FIXME logic needs review for 15 shevat
183
+ || (! tachanunRecitedPesachSheni && holidayIndex == JewishCalendar .PESACH_SHENI )))
184
+ || (! jewishCalendar .getInIsrael () && ! tachanunRecitedPesachSheni && ! tachanunRecited15IyarOutOfIsrael
185
185
&& jewishCalendar .getJewishMonth () == JewishDate .IYAR && day == 15 )
186
186
|| holidayIndex == JewishCalendar .TISHA_BEAV || jewishCalendar .isIsruChag ()
187
187
|| jewishCalendar .isRoshChodesh ()
188
- || (!tachanunRecitedShivasYemeiHamiluim &&
189
- ((!jewishCalendar .isJewishLeapYear () && month == JewishDate .ADAR )
188
+ || (! tachanunRecitedShivasYemeiHamiluim &&
189
+ ((! jewishCalendar .isJewishLeapYear () && month == JewishDate .ADAR )
190
190
|| (jewishCalendar .isJewishLeapYear () && month == JewishDate .ADAR_II )) && day > 22 )
191
- || (!tachanunRecitedWeekOfPurim &&
192
- ((!jewishCalendar .isJewishLeapYear () && month == JewishDate .ADAR )
191
+ || (! tachanunRecitedWeekOfPurim &&
192
+ ((! jewishCalendar .isJewishLeapYear () && month == JewishDate .ADAR )
193
193
|| (jewishCalendar .isJewishLeapYear () && month == JewishDate .ADAR_II )) && day > 10 && day < 18 )
194
194
|| (jewishCalendar .isUseModernHolidays ()
195
195
&& (holidayIndex == JewishCalendar .YOM_HAATZMAUT || holidayIndex == JewishCalendar .YOM_YERUSHALAYIM ))
196
- || (!tachanunRecitedWeekOfHod && month == JewishDate .IYAR && day > 13 && day < 21 )) {
196
+ || (! tachanunRecitedWeekOfHod && month == JewishDate .IYAR && day > 13 && day < 21 )) {
197
197
return false ;
198
198
}
199
199
return true ;
@@ -210,7 +210,7 @@ public boolean isTachanunRecitedMincha(JewishCalendar jewishCalendar) {
210
210
JewishCalendar tomorrow = (JewishCalendar ) jewishCalendar .clone ();
211
211
tomorrow .forward (Calendar .DATE , 1 );
212
212
213
- if (!tachanunRecitedMinchaAllYear
213
+ if (! tachanunRecitedMinchaAllYear
214
214
|| jewishCalendar .getDayOfWeek () == Calendar .FRIDAY
215
215
|| ! isTachanunRecitedShacharis (jewishCalendar )
216
216
|| (! isTachanunRecitedShacharis (tomorrow ) &&
@@ -243,7 +243,7 @@ public boolean isTachanunRecitedMincha(JewishCalendar jewishCalendar) {
243
243
public boolean isVeseinTalUmatarStartDate (JewishCalendar jewishCalendar ) {
244
244
if (jewishCalendar .getInIsrael ()) {
245
245
// The 7th Cheshvan can't occur on Shabbos, so always return true for 7 Cheshvan
246
- return jewishCalendar .getJewishMonth () == JewishDate .CHESHVAN && jewishCalendar .getJewishDayOfMonth () == 7 ;
246
+ return jewishCalendar .getJewishMonth () == JewishDate .CHESHVAN && jewishCalendar .getJewishDayOfMonth () == 7 ;
247
247
} else {
248
248
if (jewishCalendar .getDayOfWeek () == Calendar .SATURDAY ) { //Not recited on Friday night
249
249
return false ;
@@ -254,7 +254,7 @@ public boolean isVeseinTalUmatarStartDate(JewishCalendar jewishCalendar) {
254
254
return jewishCalendar .getTekufasTishreiElapsedDays () == 47 ;
255
255
}
256
256
}
257
- }
257
+ }
258
258
259
259
/**
260
260
* Returns true if tonight is the first night to start reciting <em>Vesein Tal Umatar Livracha</em> (
@@ -276,7 +276,7 @@ public boolean isVeseinTalUmatarStartDate(JewishCalendar jewishCalendar) {
276
276
public boolean isVeseinTalUmatarStartingTonight (JewishCalendar jewishCalendar ) {
277
277
if (jewishCalendar .getInIsrael ()) {
278
278
// The 7th Cheshvan can't occur on Shabbos, so always return true for 6 Cheshvan
279
- return jewishCalendar .getJewishMonth () == JewishDate .CHESHVAN && jewishCalendar .getJewishDayOfMonth () == 6 ;
279
+ return jewishCalendar .getJewishMonth () == JewishDate .CHESHVAN && jewishCalendar .getJewishDayOfMonth () == 6 ;
280
280
} else {
281
281
if (jewishCalendar .getDayOfWeek () == Calendar .FRIDAY ) { //Not recited on Friday night
282
282
return false ;
@@ -287,7 +287,7 @@ public boolean isVeseinTalUmatarStartingTonight(JewishCalendar jewishCalendar) {
287
287
return jewishCalendar .getTekufasTishreiElapsedDays () == 46 ;
288
288
}
289
289
}
290
- }
290
+ }
291
291
292
292
/**
293
293
* Returns if <em>Vesein Tal Umatar Livracha</em> (<em>Sheailas Geshamim</em>) is recited. This will return
@@ -323,7 +323,7 @@ public boolean isVeseinTalUmatarRecited(JewishCalendar jewishCalendar) {
323
323
* @see #isVeseinTalUmatarRecited(JewishCalendar)
324
324
*/
325
325
public boolean isVeseinBerachaRecited (JewishCalendar jewishCalendar ) {
326
- return !isVeseinTalUmatarRecited (jewishCalendar );
326
+ return ! isVeseinTalUmatarRecited (jewishCalendar );
327
327
}
328
328
329
329
/**
@@ -377,7 +377,7 @@ public boolean isMashivHaruachRecited(JewishCalendar jewishCalendar) {
377
377
* @return true if <em>Morid Hatal</em> (or the lack of reciting <em>Mashiv Haruach</em> following <em>nussach Ashkenaz</em>) is recited.
378
378
*/
379
379
public boolean isMoridHatalRecited (JewishCalendar jewishCalendar ) {
380
- return !isMashivHaruachRecited (jewishCalendar ) || isMashivHaruachStartDate (jewishCalendar ) || isMashivHaruachEndDate (jewishCalendar );
380
+ return ! isMashivHaruachRecited (jewishCalendar ) || isMashivHaruachStartDate (jewishCalendar ) || isMashivHaruachEndDate (jewishCalendar );
381
381
}
382
382
383
383
/**
@@ -403,23 +403,23 @@ public boolean isHallelRecited(JewishCalendar jewishCalendar) {
403
403
}
404
404
switch (month ) {
405
405
case JewishDate .NISSAN :
406
- if (day >= 15 && ((inIsrael && day <= 21 ) || (!inIsrael && day <= 22 ))){
406
+ if (day >= 15 && ((inIsrael && day <= 21 ) || (! inIsrael && day <= 22 ))){
407
407
return true ;
408
408
}
409
409
break ;
410
410
case JewishDate .IYAR : // modern holidays
411
- if (jewishCalendar .isUseModernHolidays () && (holidayIndex == JewishCalendar .YOM_HAATZMAUT
411
+ if (jewishCalendar .isUseModernHolidays () && (holidayIndex == JewishCalendar .YOM_HAATZMAUT
412
412
|| holidayIndex == JewishCalendar .YOM_YERUSHALAYIM )){
413
413
return true ;
414
414
}
415
415
break ;
416
416
case JewishDate .SIVAN :
417
- if (day == 6 || (!inIsrael && (day == 7 ))){
417
+ if (day == 6 || (! inIsrael && (day == 7 ))){
418
418
return true ;
419
419
}
420
420
break ;
421
421
case JewishDate .TISHREI :
422
- if (day >= 15 && (day <= 22 || (!inIsrael && (day <= 23 )))){
422
+ if (day >= 15 && (day <= 22 || (! inIsrael && (day <= 23 )))){
423
423
return true ;
424
424
}
425
425
}
@@ -440,7 +440,7 @@ public boolean isHallelShalemRecited(JewishCalendar jewishCalendar) {
440
440
boolean inIsrael = jewishCalendar .getInIsrael ();
441
441
if (isHallelRecited (jewishCalendar )) {
442
442
if ((jewishCalendar .isRoshChodesh () && ! jewishCalendar .isChanukah ())
443
- || (month == JewishDate .NISSAN && ((inIsrael && day > 15 ) || (!inIsrael && day > 16 )))) {
443
+ || (month == JewishDate .NISSAN && ((inIsrael && day > 15 ) || (! inIsrael && day > 16 )))) {
444
444
return false ;
445
445
} else {
446
446
return true ;
@@ -459,7 +459,7 @@ public boolean isHallelShalemRecited(JewishCalendar jewishCalendar) {
459
459
* @see JewishCalendar#getIsMukafChoma()
460
460
*/
461
461
public boolean isAlHanissimRecited (JewishCalendar jewishCalendar ) {
462
- return jewishCalendar .isPurim () || jewishCalendar .isChanukah ();
462
+ return jewishCalendar .isPurim () || jewishCalendar .isChanukah ();
463
463
}
464
464
465
465
/**
@@ -477,14 +477,14 @@ public boolean isAlHanissimRecited(JewishCalendar jewishCalendar) {
477
477
* @see JewishCalendar#isRoshChodesh()
478
478
*/
479
479
public boolean isYaalehVeyavoRecited (JewishCalendar jewishCalendar ) {
480
- return jewishCalendar .isPesach () || jewishCalendar .isShavuos () ||jewishCalendar .isRoshHashana () || jewishCalendar .isYomKippur ()
481
- || jewishCalendar .isSuccos () || jewishCalendar .isShminiAtzeres () || jewishCalendar .isSimchasTorah ()
482
- || jewishCalendar .isRoshChodesh ();
480
+ return jewishCalendar .isPesach () || jewishCalendar .isShavuos () ||jewishCalendar .isRoshHashana () || jewishCalendar .isYomKippur ()
481
+ || jewishCalendar .isSuccos () || jewishCalendar .isShminiAtzeres () || jewishCalendar .isSimchasTorah ()
482
+ || jewishCalendar .isRoshChodesh ();
483
483
}
484
484
485
485
/**
486
486
* Returns if Is <em>Mizmor Lesoda</em> is recited on the day in question.
487
- * @param jewishCalendar the Jewish calendar day.
487
+ * @param jewishCalendar the Jewish calendar day.
488
488
* @return if <em>Mizmor Lesoda</em> is recited.
489
489
*
490
490
* @see #isMizmorLesodaRecitedErevYomKippurAndPesach()
@@ -502,7 +502,7 @@ public boolean isMizmorLesodaRecited(JewishCalendar jewishCalendar) {
502
502
|| jewishCalendar .isCholHamoedPesach ())) {
503
503
return false ;
504
504
}
505
- return true ;
505
+ return true ;
506
506
}
507
507
508
508
/**
@@ -668,7 +668,7 @@ public void setTachanunRecitedPesachSheni(boolean tachanunRecitedPesachSheni) {
668
668
* JewishCalendar#PESACH_SHENI <em>Pesach Sheni</em>}) out of Israel. If {@link #isTachanunRecitedPesachSheni()} is
669
669
* <code>true</code> this will be ignored even if <code>false</code>.
670
670
*
671
- * @return if <em>tachanun</em> is set to be recited on 15 {@link JewishDate#IYAR <em>Iyar</em>} (<em>sfaika deyoma</em>
671
+ * @return if <em>tachanun</em> is set to be recited on 15 {@link JewishDate#IYAR <em>Iyar</em>} (<em>sfaika deyoma</em>
672
672
* of {@link JewishCalendar#PESACH_SHENI <em>Pesach Sheni</em>} out of Israel. If
673
673
* {@link #isTachanunRecitedPesachSheni()} is <code>true</code> this will be ignored even if <code>false</code>.
674
674
* @see #setTachanunRecited15IyarOutOfIsrael(boolean)
@@ -680,7 +680,7 @@ public boolean isTachanunRecited15IyarOutOfIsrael() {
680
680
}
681
681
682
682
/**
683
- * Sets if <em>tachanun</em> should be recited on the 15th of {@link JewishDate#IYAR <em>Iyar</em>} (<a href=
683
+ * Sets if <em>tachanun</em> should be recited on the 15th of {@link JewishDate#IYAR <em>Iyar</em>} (<a href=
684
684
* "https://en.wikipedia.org/wiki/Yom_tov_sheni_shel_galuyot"><em>Yom Tov Sheni shel Galuyos</em></a> of
685
685
* {@link JewishCalendar#PESACH_SHENI <em>Pesach Sheni</em>}) out of Israel. Ignored if {@link
686
686
* #isTachanunRecitedPesachSheni()} is <code>true</code>.
0 commit comments