From 4ac62f3b3abde4d3f52ff41ca87769f5e2a12f30 Mon Sep 17 00:00:00 2001 From: KosherJava Date: Sun, 4 Dec 2022 20:44:56 -0500 Subject: [PATCH] Add Yaaleh Veyavo and Al Hanissim Closes https://github.com/KosherJava/zmanim/issues/198 --- .../zmanim/hebrewcalendar/TefilaRules.java | 39 +++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/kosherjava/zmanim/hebrewcalendar/TefilaRules.java b/src/main/java/com/kosherjava/zmanim/hebrewcalendar/TefilaRules.java index 7c0f1fb8..d15325f9 100644 --- a/src/main/java/com/kosherjava/zmanim/hebrewcalendar/TefilaRules.java +++ b/src/main/java/com/kosherjava/zmanim/hebrewcalendar/TefilaRules.java @@ -372,12 +372,12 @@ public boolean isMoridHatalRecited(JewishCalendar jewishCalendar) { } /** - * Returns if hallel is recited on the day in question. This will return true for both hallel shalem - * and chatzi hallel. See {@link #isHallelShalemRecited(JewishCalendar)} to know if the complete hallel + * Returns if Hallel is recited on the day in question. This will return true for both Hallel shalem + * and Chatzi Hallel. See {@link #isHallelShalemRecited(JewishCalendar)} to know if the complete Hallel * is recited. * * @param jewishCalendar the Jewish calendar day. - * @return if hallel is recited. + * @return if Hallel is recited. * @see #isHallelShalemRecited(JewishCalendar) */ public boolean isHallelRecited(JewishCalendar jewishCalendar) { @@ -440,6 +440,39 @@ public boolean isHallelShalemRecited(JewishCalendar jewishCalendar) { return false; } + /** + * Returns if Al HaNissim is recited on the day in question. + * + * @param jewishCalendar the Jewish calendar day. + * @return if al hanissim is recited. + * @see JewishCalendar#isChanukah() + * @see JewishCalendar#isPurim() + * @see JewishCalendar#getIsMukafChoma() + */ + public boolean isAlHanissimRecited(JewishCalendar jewishCalendar) { + return jewishCalendar.isPurim() || jewishCalendar.isChanukah(); + } + + /** + * Returns if Yaaleh Veyavo is recited on the day in question. + * + * @param jewishCalendar the Jewish calendar day. + * @return if Yaaleh Veyavo is recited. + * @see JewishCalendar#isPesach() + * @see JewishCalendar#isShavuos() + * @see JewishCalendar#isRoshHashana() + * @see JewishCalendar#isYomKippur() + * @see JewishCalendar#isSuccos() + * @see JewishCalendar#isShminiAtzeres() + * @see JewishCalendar#isSimchasTorah() + * @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(); + } + /** * Is tachanun recited during the week of Purim, from the 11th through the 17th of {@link * JewishDate#ADAR Adar} (on a non-leap year, or {@link JewishDate#ADAR_II Adar II} on a leap year). Some