1
1
/*
2
2
* Zmanim Java API
3
- * Copyright (C) 2011 - 2021 Eliyahu Hershfeld
3
+ * Copyright (C) 2011 - 2022 Eliyahu Hershfeld
4
4
* Copyright (C) September 2002 Avrom Finkelstien
5
5
* Copyright (C) 2019 - 2021 Y Paritcher
6
6
*
35
35
*
36
36
* @todo Some do not belong in this class, but here is a partial list of what should still be implemented in some form:
37
37
* <ol>
38
- * <li>Add Isru Chag</li>
39
38
* <li>Mishna yomis etc</li>
40
39
* </ol>
41
40
*
42
41
* @see java.util.Date
43
42
* @see java.util.Calendar
44
43
* @author © Y. Paritcher 2019 - 2021
45
44
* @author © Avrom Finkelstien 2002
46
- * @author © Eliyahu Hershfeld 2011 - 2021
45
+ * @author © Eliyahu Hershfeld 2011 - 2022
47
46
*/
48
47
public class JewishCalendar extends JewishDate {
49
48
/** The 14th day of Nisan, the day before of Pesach (Passover).*/
@@ -131,6 +130,9 @@ public class JewishCalendar extends JewishDate {
131
130
132
131
/** The holiday of Purim Katan on the 15th day of Adar I on a leap year when Purim is on Adar II, a minor holiday.*/
133
132
public static final int SHUSHAN_PURIM_KATAN = 34 ;
133
+
134
+ /** The day following the last day of Pesach, Shavuos and Sukkos.*/
135
+ public static final int ISRU_CHAG = 35 ;
134
136
135
137
/**
136
138
* Is the calendar set to Israel, where some holidays have different rules.
@@ -517,6 +519,9 @@ public int getYomTovIndex() {
517
519
|| (day == 16 && inIsrael )) {
518
520
return CHOL_HAMOED_PESACH ;
519
521
}
522
+ if ((day == 22 && inIsrael ) || (day == 23 && !inIsrael )) {
523
+ return ISRU_CHAG ;
524
+ }
520
525
if (isUseModernHolidays ()
521
526
&& ((day == 26 && dayOfWeek == Calendar .THURSDAY )
522
527
|| (day == 28 && dayOfWeek == Calendar .MONDAY )
@@ -554,6 +559,9 @@ public int getYomTovIndex() {
554
559
if (day == 6 || (day == 7 && !inIsrael )) {
555
560
return SHAVUOS ;
556
561
}
562
+ if ((day == 7 && inIsrael ) || (day == 8 && !inIsrael )) {
563
+ return ISRU_CHAG ;
564
+ }
557
565
break ;
558
566
case TAMMUZ :
559
567
// push off the fast day if it falls on Shabbos
@@ -609,6 +617,9 @@ public int getYomTovIndex() {
609
617
if (day == 23 && !inIsrael ) {
610
618
return SIMCHAS_TORAH ;
611
619
}
620
+ if ((day == 23 && inIsrael ) || (day == 24 && !inIsrael )) {
621
+ return ISRU_CHAG ;
622
+ }
612
623
break ;
613
624
case KISLEV : // no yomtov in CHESHVAN
614
625
// if (day == 24) {
@@ -690,7 +701,7 @@ public int getYomTovIndex() {
690
701
public boolean isYomTov () {
691
702
int holidayIndex = getYomTovIndex ();
692
703
if ((isErevYomTov () && (holidayIndex != HOSHANA_RABBA && (holidayIndex == CHOL_HAMOED_PESACH && getJewishDayOfMonth () != 20 )))
693
- || (isTaanis () && holidayIndex != YOM_KIPPUR )) {
704
+ || (isTaanis () && holidayIndex != YOM_KIPPUR ) || holidayIndex == ISRU_CHAG ) {
694
705
return false ;
695
706
}
696
707
return getYomTovIndex () != -1 ;
@@ -1119,12 +1130,15 @@ public int getTekufasTishreiElapsedDays() {
1119
1130
* <em>Shabbos</em> and the start date will be delayed a day when the start day is on a <em>Shabbos</em> (this
1120
1131
* can only occur out of Israel).
1121
1132
*
1133
+ * @deprecated Use {@link TefilaRules#isVeseinTalUmatarStartDate(JewishCalendar)} instead.
1134
+ *
1122
1135
* @return true if it is the first Jewish day (starting the prior evening of reciting <em>Vesein Tal Umatar
1123
1136
* Livracha</em> (<em>Sheailas Geshamim</em>).
1124
1137
*
1125
1138
* @see #isVeseinTalUmatarStartingTonight()
1126
1139
* @see #isVeseinTalUmatarRecited()
1127
1140
*/
1141
+ @ Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
1128
1142
public boolean isVeseinTalUmatarStartDate () {
1129
1143
if (inIsrael ) {
1130
1144
// The 7th Cheshvan can't occur on Shabbos, so always return true for 7 Cheshvan
@@ -1152,12 +1166,15 @@ public boolean isVeseinTalUmatarStartDate() {
1152
1166
* <em>Vesein tal umatar</em> is not recited on <em>Shabbos</em> and the start date will be delayed a day when
1153
1167
* the start day is on a <em>Shabbos</em> (this can only occur out of Israel).
1154
1168
*
1169
+ * @deprecated Use {@link TefilaRules#isVeseinTalUmatarStartingTonight(JewishCalendar)} instead.
1170
+ *
1155
1171
* @return true if it is the first Jewish day (starting the prior evening of reciting <em>Vesein Tal Umatar
1156
1172
* Livracha</em> (<em>Sheailas Geshamim</em>).
1157
1173
*
1158
1174
* @see #isVeseinTalUmatarStartDate()
1159
1175
* @see #isVeseinTalUmatarRecited()
1160
1176
*/
1177
+ @ Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
1161
1178
public boolean isVeseinTalUmatarStartingTonight () {
1162
1179
if (inIsrael ) {
1163
1180
// The 7th Cheshvan can't occur on Shabbos, so always return true for 6 Cheshvan
@@ -1180,11 +1197,15 @@ public boolean isVeseinTalUmatarStartingTonight() {
1180
1197
/**
1181
1198
* Returns if <em>Vesein Tal Umatar Livracha</em> (<em>Sheailas Geshamim</em>) is recited. This will return
1182
1199
* true for the entire season, even on <em>Shabbos</em> when it is not recited.
1200
+ *
1201
+ * @deprecated Use {@link TefilaRules#isVeseinTalUmatarRecited(JewishCalendar)} instead.
1202
+ *
1183
1203
* @return true if <em>Vesein Tal Umatar Livracha</em> (<em>Sheailas Geshamim</em>) is recited.
1184
1204
*
1185
1205
* @see #isVeseinTalUmatarStartDate()
1186
1206
* @see #isVeseinTalUmatarStartingTonight()
1187
1207
*/
1208
+ @ Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
1188
1209
public boolean isVeseinTalUmatarRecited () {
1189
1210
if (getJewishMonth () == NISSAN && getJewishDayOfMonth () < 15 ) {
1190
1211
return true ;
@@ -1203,34 +1224,43 @@ public boolean isVeseinTalUmatarRecited() {
1203
1224
* Returns if <em>Vesein Beracha</em> is recited. It is recited from 15 <em>Nissan</em> to the point that {@link
1204
1225
* #isVeseinTalUmatarRecited() <em>vesein tal umatar</em> is recited}.
1205
1226
*
1227
+ * @deprecated Use {@link TefilaRules#isVeseinBerachaRecited(JewishCalendar)} instead.
1228
+ *
1206
1229
* @return true if <em>Vesein Beracha</em> is recited.
1207
1230
*
1208
1231
* @see #isVeseinTalUmatarRecited()
1209
1232
*/
1233
+ @ Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
1210
1234
public boolean isVeseinBerachaRecited () {
1211
1235
return !isVeseinTalUmatarRecited ();
1212
1236
}
1213
1237
1214
1238
/**
1215
1239
* Returns if the date is the start date for reciting <em>Mashiv Haruach Umorid Hageshem</em>. The date is 22 <em>Tishrei</em>.
1216
1240
*
1241
+ * @deprecated Use {@link TefilaRules#isMashivHaruachStartDate(JewishCalendar)} instead.
1242
+ *
1217
1243
* @return true if the date is the start date for reciting <em>Mashiv Haruach Umorid Hageshem</em>.
1218
1244
*
1219
1245
* @see #isMashivHaruachEndDate()
1220
1246
* @see #isMashivHaruachRecited()
1221
1247
*/
1248
+ @ Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
1222
1249
public boolean isMashivHaruachStartDate () {
1223
1250
return getJewishMonth () == TISHREI && getJewishDayOfMonth () == 22 ;
1224
1251
}
1225
1252
1226
1253
/**
1227
1254
* Returns if the date is the end date for reciting <em>Mashiv Haruach Umorid Hageshem</em>. The date is 15 <em>Nissan</em>.
1228
1255
*
1256
+ * @deprecated Use {@link TefilaRules#isMashivHaruachEndDate(JewishCalendar)} instead.
1257
+ *
1229
1258
* @return true if the date is the end date for reciting <em>Mashiv Haruach Umorid Hageshem</em>.
1230
1259
*
1231
1260
* @see #isMashivHaruachStartDate()
1232
1261
* @see #isMashivHaruachRecited()
1233
1262
*/
1263
+ @ Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
1234
1264
public boolean isMashivHaruachEndDate () {
1235
1265
return getJewishMonth () == NISSAN && getJewishDayOfMonth () == 15 ;
1236
1266
}
@@ -1240,11 +1270,14 @@ public boolean isMashivHaruachEndDate() {
1240
1270
* on the 15th day of <em>Nissan</em>.
1241
1271
* <em>Marcheshvan</em>. Outside of Israel recitation starts on December 4/5.
1242
1272
*
1273
+ * @deprecated Use {@link TefilaRules#isMashivHaruachRecited(JewishCalendar)} instead.
1274
+ *
1243
1275
* @return true if <em>Mashiv Haruach Umorid Hageshem</em> is recited.
1244
1276
*
1245
1277
* @see #isMashivHaruachStartDate()
1246
1278
* @see #isMashivHaruachEndDate()
1247
1279
*/
1280
+ @ Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
1248
1281
public boolean isMashivHaruachRecited () {
1249
1282
JewishDate startDate = new JewishDate (getJewishYear (), TISHREI , 22 );
1250
1283
JewishDate endDate = new JewishDate (getJewishYear (), NISSAN , 15 );
@@ -1256,11 +1289,28 @@ public boolean isMashivHaruachRecited() {
1256
1289
* This period starts on 22 <em>Tishrei</em> and ends on the 15th day of
1257
1290
* <em>Nissan</em>.
1258
1291
*
1292
+ * @deprecated Use {@link TefilaRules#isMoridHatalRecited(JewishCalendar)} instead.
1293
+ *
1259
1294
* @return true if <em>Morid Hatal</em> (or the lack of reciting <em>Mashiv Haruach</em> following <em>nussach Ashkenaz</em>) is recited.
1260
1295
*/
1296
+ @ Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
1261
1297
public boolean isMoridHatalRecited () {
1262
1298
return !isMashivHaruachRecited () || isMashivHaruachStartDate () || isMashivHaruachEndDate ();
1263
1299
}
1300
+
1301
+ /**
1302
+ * Returns true if the current day is erev Yom Tov. The method returns true for <em>Erev</em> - <em>Pesach</em> (first and
1303
+ * last days), <em>Shavuos</em>, <em>Rosh Hashana</em>, <em>Yom Kippur</em>, <em>Succos</em> and <em>Hoshana Rabba</em>.
1304
+ *
1305
+ * @return true if the current day is <em>Erev</em> - <em>Pesach</em>, <em>Shavuos</em>, <em>Rosh Hashana</em>, <em>Yom
1306
+ * Kippur</em>, <em>Succos</em> and <em>Hoshana Rabba</em>.
1307
+ * @see #isYomTov()
1308
+ * @see #isErevYomTovSheni()
1309
+ */
1310
+ public boolean isIsruChag () {
1311
+ int holidayIndex = getYomTovIndex ();
1312
+ return holidayIndex == ISRU_CHAG ;
1313
+ }
1264
1314
1265
1315
/**
1266
1316
* Indicates whether some other object is "equal to" this one.
0 commit comments