1
1
/*
2
2
* Zmanim Java API
3
- * Copyright (C) 2011 - 2023 Eliyahu Hershfeld
3
+ * Copyright (C) 2011 - 2024 Eliyahu Hershfeld
4
4
* Copyright (C) September 2002 Avrom Finkelstien
5
5
* Copyright (C) 2019 - 2022 Y Paritcher
6
6
*
26
26
27
27
/**
28
28
* The JewishCalendar extends the JewishDate class and adds calendar methods.
29
- * <p>
29
+ *
30
30
* This open source Java code was originally ported by <a href="http://www.facebook.com/avromf">Avrom Finkelstien</a>
31
31
* from his C++ code. It was refactored to fit the KosherJava Zmanim API with simplification of the code, enhancements
32
32
* and some bug fixing. The class allows setting whether the holiday and <em>parsha</em> scheme follows the Israel scheme
42
42
* @see java.util.Calendar
43
43
* @author © Y. Paritcher 2019 - 2022
44
44
* @author © Avrom Finkelstien 2002
45
- * @author © Eliyahu Hershfeld 2011 - 2023
45
+ * @author © Eliyahu Hershfeld 2011 - 2024
46
46
*/
47
47
public class JewishCalendar extends JewishDate {
48
48
/** The 14th day of Nissan, the day before Pesach (Passover).*/
@@ -387,9 +387,8 @@ public boolean isBirkasHachamah() {
387
387
* Rosh Hashana as 1, we have to add 1 day for a total of 171. To this add a day since the tekufah is on a Tuesday
388
388
* night, and we push off the bracha to Wednesday morning resulting in the 172 used in the calculation.
389
389
*/
390
- // 28 years of 365.25 days + the offset from molad tohu mentioned above
391
- return elapsedDays % (28 * 365.25 ) == 172 ;
392
- }
390
+ return elapsedDays % (28 * 365.25 ) == 172 ; // 28 years of 365.25 days + the offset from molad tohu mentioned above
391
+ }
393
392
394
393
/**
395
394
* Return the type of year for <em>parsha</em> calculations. The algorithm follows the
@@ -704,7 +703,7 @@ public int getYomTovIndex() {
704
703
if (day == 15 || (day == 16 && !inIsrael )) {
705
704
return SUCCOS ;
706
705
}
707
- if (day >= 17 && day <= 20 || day == 16 ) {
706
+ if (day >= 16 && day <= 20 ) {
708
707
return CHOL_HAMOED_SUCCOS ;
709
708
}
710
709
if (day == 21 ) {
@@ -785,7 +784,7 @@ public int getYomTovIndex() {
785
784
/**
786
785
* Returns true if the current day is <em>Yom Tov</em>. The method returns true even for holidays such as {@link #CHANUKAH}
787
786
* and minor ones such as {@link #TU_BEAV} and {@link #PESACH_SHENI}. <em>Erev Yom Tov</em> (with the exception of
788
- * {@link #HOSHANA_RABBA}, and <em>erev</em> the second days of {@link #PESACH}) returns false, as do {@link #isTaanis() fast
787
+ * {@link #HOSHANA_RABBA} and <em>erev</em> the second days of {@link #PESACH}) returns false, as do {@link #isTaanis() fast
789
788
* days} besides {@link #YOM_KIPPUR}. Use {@link #isAssurBemelacha()} to find the days that have a prohibition of work.
790
789
*
791
790
* @return true if the current day is a Yom Tov
@@ -799,7 +798,7 @@ public int getYomTovIndex() {
799
798
*/
800
799
public boolean isYomTov () {
801
800
int holidayIndex = getYomTovIndex ();
802
- if ((isErevYomTov () && (holidayIndex != HOSHANA_RABBA || ( holidayIndex == CHOL_HAMOED_PESACH && getJewishDayOfMonth () != 20 ) ))
801
+ if ((isErevYomTov () && (holidayIndex != HOSHANA_RABBA && holidayIndex != CHOL_HAMOED_PESACH ))
803
802
|| (isTaanis () && holidayIndex != YOM_KIPPUR ) || holidayIndex == ISRU_CHAG ) {
804
803
return false ;
805
804
}
@@ -1065,9 +1064,8 @@ public boolean isYomKippurKatan() {
1065
1064
if (day == 29 && dayOfWeek != Calendar .FRIDAY && dayOfWeek != Calendar .SATURDAY ) {
1066
1065
return true ;
1067
1066
}
1068
-
1069
- return (day == 27 || day == 28 ) && dayOfWeek == Calendar .THURSDAY ;
1070
- }
1067
+ return (day == 27 || day == 28 ) && dayOfWeek == Calendar .THURSDAY ;
1068
+ }
1071
1069
1072
1070
/**
1073
1071
* The Monday, Thursday and Monday after the first <em>Shabbos</em> after {@link #isRoshChodesh() <em>Rosh Chodesh</em>}
@@ -1084,8 +1082,8 @@ public boolean isBeHaB() {
1084
1082
int day = getJewishDayOfMonth ();
1085
1083
1086
1084
if (month == JewishDate .CHESHVAN || month == JewishDate .IYAR ) {
1087
- return (dayOfWeek == Calendar .MONDAY && day > 4 && day < 18 )
1088
- || (dayOfWeek == Calendar .THURSDAY && day > 7 && day < 14 );
1085
+ return (dayOfWeek == Calendar .MONDAY && day > 4 && day < 18 )
1086
+ || (dayOfWeek == Calendar .THURSDAY && day > 7 && day < 14 );
1089
1087
}
1090
1088
return false ;
1091
1089
}
@@ -1419,7 +1417,7 @@ public int getTekufasTishreiElapsedDays() {
1419
1417
public boolean isVeseinTalUmatarStartDate () {
1420
1418
if (inIsrael ) {
1421
1419
// The 7th Cheshvan can't occur on Shabbos, so always return true for 7 Cheshvan
1422
- return getJewishMonth () == CHESHVAN && getJewishDayOfMonth () == 7 ;
1420
+ return getJewishMonth () == CHESHVAN && getJewishDayOfMonth () == 7 ;
1423
1421
} else {
1424
1422
if (getDayOfWeek () == Calendar .SATURDAY ) { //Not recited on Friday night
1425
1423
return false ;
@@ -1430,7 +1428,7 @@ public boolean isVeseinTalUmatarStartDate() {
1430
1428
return getTekufasTishreiElapsedDays () == 47 ;
1431
1429
}
1432
1430
}
1433
- }
1431
+ }
1434
1432
1435
1433
/**
1436
1434
* Returns true if tonight is the first night to start reciting <em>Vesein Tal Umatar Livracha</em> (
@@ -1453,7 +1451,7 @@ public boolean isVeseinTalUmatarStartDate() {
1453
1451
public boolean isVeseinTalUmatarStartingTonight () {
1454
1452
if (inIsrael ) {
1455
1453
// The 7th Cheshvan can't occur on Shabbos, so always return true for 6 Cheshvan
1456
- return getJewishMonth () == CHESHVAN && getJewishDayOfMonth () == 6 ;
1454
+ return getJewishMonth () == CHESHVAN && getJewishDayOfMonth () == 6 ;
1457
1455
} else {
1458
1456
if (getDayOfWeek () == Calendar .FRIDAY ) { //Not recited on Friday night
1459
1457
return false ;
@@ -1464,7 +1462,7 @@ public boolean isVeseinTalUmatarStartingTonight() {
1464
1462
return getTekufasTishreiElapsedDays () == 46 ;
1465
1463
}
1466
1464
}
1467
- }
1465
+ }
1468
1466
1469
1467
/**
1470
1468
* Returns if <em>Vesein Tal Umatar Livracha</em> (<em>Sheailas Geshamim</em>) is recited. This will return
0 commit comments