From bd6f21bd17b4271af580dc0debfa6d5a64ddce7d Mon Sep 17 00:00:00 2001 From: Ely Date: Wed, 10 Jan 2024 22:41:43 -0700 Subject: [PATCH 1/2] add method checking for a shmita year --- .../zmanim/hebrewcalendar/JewishCalendar.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishCalendar.java b/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishCalendar.java index 3e37cea7..9325c9d0 100644 --- a/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishCalendar.java +++ b/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishCalendar.java @@ -1601,6 +1601,18 @@ public boolean isIsruChag() { return holidayIndex == ISRU_CHAG; } + /** + * Returns true if the current year is a Shmita (Jubilee) year. The method returns true for years that are + * divisible by 7. However, Rashi and other rishonim hold that the year before what this method returns true for is + * the actual year of Shmita. + * + * @return true if the current year is a Shmikta (Jubilee) year. + */ + public boolean isShmitaYear() { + int holidayIndex = getYomTovIndex(); + return holidayIndex == ISRU_CHAG; + } + /** * Indicates whether some other object is "equal to" this one. * @see Object#equals(Object) From 3e0619c2bbe937e2c2b905b4a0ac40fbe1ee2b77 Mon Sep 17 00:00:00 2001 From: Ely Date: Wed, 17 Jan 2024 14:50:33 -0700 Subject: [PATCH 2/2] actually implement shmita code --- .../com/kosherjava/zmanim/hebrewcalendar/JewishCalendar.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishCalendar.java b/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishCalendar.java index 9325c9d0..05d4cae4 100644 --- a/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishCalendar.java +++ b/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishCalendar.java @@ -1609,8 +1609,7 @@ public boolean isIsruChag() { * @return true if the current year is a Shmikta (Jubilee) year. */ public boolean isShmitaYear() { - int holidayIndex = getYomTovIndex(); - return holidayIndex == ISRU_CHAG; + return getJewishYear() % 7 == 0; } /**