Class JewishCalendar
java.lang.Object
com.kosherjava.zmanim.hebrewcalendar.JewishDate
com.kosherjava.zmanim.hebrewcalendar.JewishCalendar
- All Implemented Interfaces:
Cloneable
,Comparable<JewishDate>
The JewishCalendar extends the JewishDate class and adds calendar methods.
This open source Java code was originally ported by Avrom Finkelstien
from his C++ code. It was refactored to fit the KosherJava Zmanim API with simplification of the code, enhancements
and some bug fixing. The class allows setting whether the holiday and parsha scheme follows the Israel scheme
or outside Israel scheme. The default is the outside Israel scheme.
The parsha code was ported by Y. Paritcher from his libzmanim code.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The Monday, Thursday and Monday after the first Shabbos after Rosh Chodesh Cheshvan and Iyar) are BeHab days.static final int
The holiday of Chanukah. 8 days starting on the 25th day Kislev.static final int
Chol Hamoed (interim days) of Pesach (Passover)static final int
Chol Hamoed (interim days) of Succos/Sukkos (Tabernacles)static final int
The 14th day of Nissan, the day before of Pesach (Passover).static final int
Erev Rosh Hashana (the day before Rosh Hashana), the 29th of Elulstatic final int
Erev Shavuos (the day before Shavuos), the 5th of Sivanstatic final int
The 14th day of Tishrei, the day before of Succos/Sukkos (Tabernacles).static final int
The 9th day of Tishrei, the day before of Yom Kippur.static final int
The fast of Esther, usually on the 13th day of Adar (or Adar II on leap years).static final int
The fast of Gedalyah, the 3rd of Tishrei.static final int
Hoshana Rabba, the 7th day of Succos/Sukkos that occurs on the 21st of Tishrei.private boolean
Is the calendar set to Israel, where some holidays have different rules.private boolean
Is the calendar set to have Purim demukafim, where Purim is celebrated on Shushan Purim.static final int
The day following the last day of Pesach, Shavuos and Sukkos.static final int
The 33rd day of the Omer, the 18th of Iyar, a minor holiday.static final JewishCalendar.Parsha[][]
An array of parshiyos in the 17 possible combinations.static final int
The holiday of Pesach (Passover) on the 15th (and 16th out of Israel) day of Nissan.static final int
Pesach Sheni, the 14th day of Iyar, a minor holiday.static final int
The holiday of Purim on the 14th day of Adar (or Adar II on leap years).static final int
The holiday of Purim Katan on the 14th day of Adar I on a leap year when Purim is on Adar II, a minor holiday.static final int
Rosh Chodesh, the new moon on the first day of the Jewish month, and the 30th day of the previous month in the case of a month with 30 days.static final int
Rosh Hashana, the first of Tishrei.static final int
The fast of the 17th day of Tamuzstatic final int
Shavuos (Pentecost), the 6th of Sivanstatic final int
Shmini Atzeres, the 8th day of Succos/Sukkos is an independent holiday that occurs on the 22nd of Tishrei.static final int
The holiday of Shushan Purim on the 15th day of Adar (or Adar II on leap years).static final int
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.static final int
Simchas Torah, the 9th day of Succos/Sukkos, or the second day of Shmini Atzeres that is celebratedout of Israel
on the 23rd of Tishrei.static final int
The holiday of Succos/Sukkos (Tabernacles), the 15th (and 16th out of Israel) day of Tishreistatic final int
The fast of the 10th day of Teves.static final int
The fast of the 9th of Avstatic final int
The 15th day of Av, a minor holidaystatic final int
Tu Bishvat on the 15th day of Shevat, a minor holiday.private boolean
Is the calendar set to use modern Israeli holidays such as Yom Haatzmaut.static final int
Yom Ha'atzmaut, Israel Independence Day, the 5th of Iyar, but if it occurs on a Friday or Saturday, the holiday is moved back to Thursday, the 3rd of 4th of Iyar, and if it falls on a Monday, it is moved forward to Tuesday the 6th of Iyar.static final int
Yom HaShoah, Holocaust Remembrance Day, usually held on the 27th of Nissan.static final int
Yom HaZikaron, Israeli Memorial Day, held a day before Yom Ha'atzmaut.static final int
The holiday of Yom Kippur, the 10th day of Tishreistatic final int
The day before Rosh Chodesh (moved to Thursday if Rosh Chodesh is on a Friday or Shabbos) in most months.static final int
Yom Yerushalayim or Jerusalem Day, on 28 Iyar. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor will set a default date to the current system date.JewishCalendar
(int jewishYear, int jewishMonth, int jewishDayOfMonth) Creates a Jewish date based on a Jewish year, month and day of month.JewishCalendar
(int jewishYear, int jewishMonth, int jewishDayOfMonth, boolean inIsrael) Creates a Jewish date based on a Jewish date and whether in IsraelJewishCalendar
(LocalDate localDate) A constructor that initializes the date to theLocalDate
parameter.JewishCalendar
(Calendar calendar) A constructor that initializes the date to theCalendar
parameter.JewishCalendar
(Date date) A constructor that initializes the date to theDate
parameter. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.Returns the Daf Yomi (Bavli) for the date that the calendar is set to.Returns the Daf Yomi (Yerushalmi) for the date that the calendar is set to.int
Returns the day of Chanukah or -1 if it is not Chanukah.int
Returns the int value of the Omer day or -1 if the day is not in the Omer.boolean
Gets whether Israel holiday scheme is used or not.boolean
Returns if the city is set as a city surrounded by a wall from the time of Yehoshua, and Shushan Purim should be celebrated as opposed to regular Purim.Returns the molad in Standard Time in Yerushalayim as a Date.Returns this week'sParsha
if it is Shabbos.private int
Return the type of year for parsha calculations.Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the opinion brought down in the Shulchan Aruch (Orach Chaim 426).Returns the latest time of Kiddush Levana according to the Maharil's opinion that it is calculated as halfway between molad and molad.Returns the earliest time of Kiddush Levana calculated as 3 days after the molad.Returns the earliest time of Kiddush Levana calculated as 7 days after the molad as mentioned by the Mechaber.int
Returns the elapsed days since Tekufas Tishrei.Returns the upcomingParsha
regardless of if it is the weekday or Shabbos (where next Shabbos's Parsha will be returned.int
Returns an index of the Jewish holiday or fast day for the current day, or a -1 if there is no holiday for this day.boolean
Returns true if the day has candle lighting.int
hashCode()
OverridesObject.hashCode()
.boolean
Returns true if the current day is Aseres Yemei Teshuva.boolean
Returns true if it is Shabbos or if it is a Yom Tov day that has a melacha (work) prohibition.boolean
isBeHaB()
The Monday, Thursday and Monday after the first Shabbos afterRosh Chodesh
Cheshvan
andIyar
are BeHaB days.boolean
Birkas Hachamah is recited every 28 years based on Tekufas Shmuel (Julian years) that a year is 365.25 days.boolean
Returns true if the current day is one of the 8 days of Chanukah.boolean
Returns true if the current day is Chol Hamoed of Pesach or Succos.boolean
Returns true if the current day is Chol Hamoed of Pesach.boolean
Returns true if the current day is Chol Hamoed of Succos.boolean
Returns true if the current day is Erev Rosh Chodesh.boolean
Returns true if the current day is Erev Yom Tov.boolean
Returns true if the day is the second day of Yom Tov.boolean
Returns true if the current day is Hoshana Rabba.boolean
Returns true if the current day is Isru Chag.boolean
Returns if the day is Shabbos and Sunday is Rosh Chodesh.boolean
Deprecated.boolean
Deprecated.UseTefilaRules.isMashivHaruachRecited(JewishCalendar)
instead.boolean
Deprecated.UseTefilaRules.isMashivHaruachStartDate(JewishCalendar)
instead.boolean
Deprecated.UseTefilaRules.isMoridHatalRecited(JewishCalendar)
instead.boolean
isPesach()
Returns true if the current day is Pesach (either the Yom Tov of Pesach orChol Hamoed Pesach).boolean
isPurim()
Returns if the day is Purim (Shushan Purim in a mukaf choma and regular Purim in a non-mukaf choma).boolean
Returns if the day is Rosh Chodesh.boolean
Returns true if the current day is Rosh Hashana.boolean
Returns if the day is Shabbos Mevorchim.boolean
Returns true if the current day is Shavuos.boolean
Returns true if the current day is Shmini Atzeres.boolean
Returns true if the current day is Simchas Torah.boolean
isSuccos()
Returns true if the current day is Succos (either the Yom Tov of Succos orChol Hamoed Succos).boolean
isTaanis()
Return true if the day is a Taanis (fast day).boolean
Return true if the day is Taanis Bechoros (on Erev Pesach).boolean
Returns if the day is Tisha Be'Av (the 9th of Av).boolean
Returns true if tomorrow is Shabbos or Yom Tov.boolean
Is this calendar set to return modern Israeli national holidays.boolean
Deprecated.UseTefilaRules.isVeseinBerachaRecited(JewishCalendar)
instead.boolean
Deprecated.UseTefilaRules.isVeseinTalUmatarRecited(JewishCalendar)
instead.boolean
Deprecated.boolean
Deprecated.boolean
Returns true if the current day is Yom Kippur.boolean
Returns true if the current day is Yom Kippur Katan.boolean
isYomTov()
Returns true if the current day is Yom Tov.boolean
Returns true if the Yom Tov day has a melacha (work) prohibition.void
setInIsrael
(boolean inIsrael) Sets whether to use Israel holiday scheme or not.void
setIsMukafChoma
(boolean isMukafChoma) Sets if the location is surrounded by a wall from the time of Yehoshua, and Shushan Purim should be celebrated as opposed to regular Purim.void
setUseModernHolidays
(boolean useModernHolidays) Sets the calendar to return modern Israeli national holidays.Methods inherited from class com.kosherjava.zmanim.hebrewcalendar.JewishDate
back, clone, compareTo, forward, getAbsDate, getChalakimSinceMoladTohu, getCheshvanKislevKviah, getDayOfWeek, getDaysInJewishMonth, getDaysInJewishYear, getDaysInJewishYear, getDaysSinceStartOfJewishYear, getGregorianCalendar, getGregorianDayOfMonth, getGregorianMonth, getGregorianYear, getJewishCalendarElapsedDays, getJewishDayOfMonth, getJewishMonth, getJewishYear, getLastDayOfGregorianMonth, getLocalDate, getMolad, getMoladChalakim, getMoladHours, getMoladMinutes, isCheshvanLong, isGregorianLeapYear, isJewishLeapYear, isKislevShort, resetDate, setDate, setDate, setDate, setGregorianDate, setGregorianDayOfMonth, setGregorianMonth, setGregorianYear, setJewishDate, setJewishDate, setJewishDayOfMonth, setJewishMonth, setJewishYear, setMoladChalakim, setMoladHours, setMoladMinutes, toString
-
Field Details
-
EREV_PESACH
The 14th day of Nissan, the day before of Pesach (Passover).- See Also:
-
PESACH
The holiday of Pesach (Passover) on the 15th (and 16th out of Israel) day of Nissan.- See Also:
-
CHOL_HAMOED_PESACH
Chol Hamoed (interim days) of Pesach (Passover)- See Also:
-
PESACH_SHENI
Pesach Sheni, the 14th day of Iyar, a minor holiday.- See Also:
-
EREV_SHAVUOS
Erev Shavuos (the day before Shavuos), the 5th of Sivan- See Also:
-
SHAVUOS
Shavuos (Pentecost), the 6th of Sivan- See Also:
-
SEVENTEEN_OF_TAMMUZ
The fast of the 17th day of Tamuz- See Also:
-
TISHA_BEAV
The fast of the 9th of Av- See Also:
-
TU_BEAV
The 15th day of Av, a minor holiday- See Also:
-
EREV_ROSH_HASHANA
Erev Rosh Hashana (the day before Rosh Hashana), the 29th of Elul- See Also:
-
ROSH_HASHANA
Rosh Hashana, the first of Tishrei.- See Also:
-
FAST_OF_GEDALYAH
The fast of Gedalyah, the 3rd of Tishrei.- See Also:
-
EREV_YOM_KIPPUR
The 9th day of Tishrei, the day before of Yom Kippur.- See Also:
-
YOM_KIPPUR
The holiday of Yom Kippur, the 10th day of Tishrei- See Also:
-
EREV_SUCCOS
The 14th day of Tishrei, the day before of Succos/Sukkos (Tabernacles).- See Also:
-
SUCCOS
The holiday of Succos/Sukkos (Tabernacles), the 15th (and 16th out of Israel) day of Tishrei- See Also:
-
CHOL_HAMOED_SUCCOS
Chol Hamoed (interim days) of Succos/Sukkos (Tabernacles)- See Also:
-
HOSHANA_RABBA
Hoshana Rabba, the 7th day of Succos/Sukkos that occurs on the 21st of Tishrei.- See Also:
-
SHEMINI_ATZERES
Shmini Atzeres, the 8th day of Succos/Sukkos is an independent holiday that occurs on the 22nd of Tishrei.- See Also:
-
SIMCHAS_TORAH
Simchas Torah, the 9th day of Succos/Sukkos, or the second day of Shmini Atzeres that is celebratedout of Israel
on the 23rd of Tishrei.- See Also:
-
CHANUKAH
The holiday of Chanukah. 8 days starting on the 25th day Kislev.- See Also:
-
TENTH_OF_TEVES
The fast of the 10th day of Teves.- See Also:
-
TU_BESHVAT
Tu Bishvat on the 15th day of Shevat, a minor holiday.- See Also:
-
FAST_OF_ESTHER
The fast of Esther, usually on the 13th day of Adar (or Adar II on leap years). It is earlier on some years.- See Also:
-
PURIM
The holiday of Purim on the 14th day of Adar (or Adar II on leap years).- See Also:
-
SHUSHAN_PURIM
The holiday of Shushan Purim on the 15th day of Adar (or Adar II on leap years).- See Also:
-
PURIM_KATAN
The holiday of Purim Katan on the 14th day of Adar I on a leap year when Purim is on Adar II, a minor holiday.- See Also:
-
ROSH_CHODESH
Rosh Chodesh, the new moon on the first day of the Jewish month, and the 30th day of the previous month in the case of a month with 30 days.- See Also:
-
YOM_HASHOAH
Yom HaShoah, Holocaust Remembrance Day, usually held on the 27th of Nissan. If it falls on a Friday, it is moved to the 26th, and if it falls on a Sunday it is moved to the 28th. Amodern holiday
.- See Also:
-
YOM_HAZIKARON
Yom HaZikaron, Israeli Memorial Day, held a day before Yom Ha'atzmaut. Amodern holiday
.- See Also:
-
YOM_HAATZMAUT
Yom Ha'atzmaut, Israel Independence Day, the 5th of Iyar, but if it occurs on a Friday or Saturday, the holiday is moved back to Thursday, the 3rd of 4th of Iyar, and if it falls on a Monday, it is moved forward to Tuesday the 6th of Iyar. Amodern holiday
.- See Also:
-
YOM_YERUSHALAYIM
Yom Yerushalayim or Jerusalem Day, on 28 Iyar. Amodern holiday
.- See Also:
-
LAG_BAOMER
The 33rd day of the Omer, the 18th of Iyar, a minor holiday.- See Also:
-
SHUSHAN_PURIM_KATAN
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.- See Also:
-
ISRU_CHAG
The day following the last day of Pesach, Shavuos and Sukkos.- See Also:
-
YOM_KIPPUR_KATAN
The day before Rosh Chodesh (moved to Thursday if Rosh Chodesh is on a Friday or Shabbos) in most months. This constant is not actively in use.- See Also:
-
BEHAB
The Monday, Thursday and Monday after the first Shabbos after Rosh Chodesh Cheshvan and Iyar) are BeHab days. This constant is not actively in use.- See Also:
-
inIsrael
Is the calendar set to Israel, where some holidays have different rules.- See Also:
-
isMukafChoma
Is the calendar set to have Purim demukafim, where Purim is celebrated on Shushan Purim.- See Also:
-
useModernHolidays
Is the calendar set to use modern Israeli holidays such as Yom Haatzmaut. -
parshalist
An array of parshiyos in the 17 possible combinations.
-
-
Constructor Details
-
JewishCalendar
public JewishCalendar()Default constructor will set a default date to the current system date. -
JewishCalendar
A constructor that initializes the date to theDate
parameter.- Parameters:
date
- theDate
to set the calendar to
-
JewishCalendar
A constructor that initializes the date to theCalendar
parameter.- Parameters:
calendar
- theCalendar
to set the calendar to
-
JewishCalendar
A constructor that initializes the date to theLocalDate
parameter.- Parameters:
localDate
- theLocalDate
to set the calendar to
-
JewishCalendar
Creates a Jewish date based on a Jewish year, month and day of month.- Parameters:
jewishYear
- the Jewish yearjewishMonth
- the Jewish month. The method expects a 1 for Nissan ... 12 for Adar and 13 for Adar II. Use the constantsJewishDate.NISSAN
...JewishDate.ADAR
(orJewishDate.ADAR_II
for a leap year Adar II) to avoid any confusion.jewishDayOfMonth
- the Jewish day of month. If 30 is passed in for a month with only 29 days (for exampleJewishDate.IYAR
, orJewishDate.KISLEV
in a year thatJewishDate.isKislevShort()
), the 29th (last valid date of the month) will be set- Throws:
IllegalArgumentException
- if the day of month is < 1 or > 30, or a year of < 0 is passed in.
-
JewishCalendar
Creates a Jewish date based on a Jewish date and whether in Israel- Parameters:
jewishYear
- the Jewish yearjewishMonth
- the Jewish month. The method expects a 1 for Nissan ... 12 for Adar and 13 for Adar II. Use the constantsJewishDate.NISSAN
...JewishDate.ADAR
(orJewishDate.ADAR_II
for a leap year Adar II) to avoid any confusion.jewishDayOfMonth
- the Jewish day of month. If 30 is passed in for a month with only 29 days (for exampleJewishDate.IYAR
, orJewishDate.KISLEV
in a year thatJewishDate.isKislevShort()
), the 29th (last valid date of the month) will be set.inIsrael
- whether in Israel. This affects Yom Tov calculations
-
-
Method Details
-
isUseModernHolidays
Is this calendar set to return modern Israeli national holidays. By default this value is false. The holidays areYom HaShoah
,Yom Hazikaron
,Yom Ha'atzmaut
andYom Yerushalayim
.- Returns:
- the useModernHolidays true if set to return modern Israeli national holidays
- See Also:
-
setUseModernHolidays
Sets the calendar to return modern Israeli national holidays. By default this value is false. The holidays are:Yom HaShoah
,Yom Hazikaron
,Yom Ha'atzmaut
andYom Yerushalayim
.- Parameters:
useModernHolidays
- the useModernHolidays to set- See Also:
-
setInIsrael
Sets whether to use Israel holiday scheme or not. Default is false.- Parameters:
inIsrael
- set to true for calculations for Israel- See Also:
-
getInIsrael
Gets whether Israel holiday scheme is used or not. The default (if not set) is false.- Returns:
- if the calendar is set to Israel
- See Also:
-
getIsMukafChoma
Returns if the city is set as a city surrounded by a wall from the time of Yehoshua, and Shushan Purim should be celebrated as opposed to regular Purim.- Returns:
- if the city is set as a city surrounded by a wall from the time of Yehoshua, and Shushan Purim should be celebrated as opposed to regular Purim.
- See Also:
-
setIsMukafChoma
Sets if the location is surrounded by a wall from the time of Yehoshua, and Shushan Purim should be celebrated as opposed to regular Purim. This should be set for Yerushalayim, Shushan and other cities.- Parameters:
isMukafChoma
- is the city surrounded by a wall from the time of Yehoshua.- See Also:
-
isBirkasHachamah
Birkas Hachamah is recited every 28 years based on Tekufas Shmuel (Julian years) that a year is 365.25 days. The Rambam in Hilchos Kiddush Hachodesh 9:3 states that tekufas Nissan of year 1 was 7 days + 9 hours before molad Nissan. This is calculated as every 10,227 days (28 * 365.25).- Returns:
- true for a day that Birkas Hachamah is recited.
-
getParshaYearType
Return the type of year for parsha calculations. The algorithm follows the Luach Arba'ah Shearim in the Tur Ohr Hachaim.- Returns:
- the type of year for parsha calculations.
-
getParshah
Returns this week'sParsha
if it is Shabbos. It returnsJewishCalendar.Parsha.NONE
if the date is a weekday or if there is no parsha that week (for example Yom Tov that falls on a Shabbos).- Returns:
- the current parsha.
-
getUpcomingParshah
Returns the upcomingParsha
regardless of if it is the weekday or Shabbos (where next Shabbos's Parsha will be returned. This is unlikegetParshah()
that returnsJewishCalendar.Parsha.NONE
if the date is not Shabbos. If the upcoming Shabbos is a Yom Tov and has no Parsha, the following week's Parsha will be returned.- Returns:
- the upcoming parsha.
-
getSpecialShabbos
Returns aParsha
enum if the Shabbos is one of the four parshiyos ofShkalim
,Zachor
,Para
,Hachdesh
orParsha.NONE
for a regular Shabbos (or any weekday).- Returns:
- one of the four parshiyos of
Shkalim
Zachor
,Para
,Hachdesh
orParsha.NONE
.
-
getYomTovIndex
Returns an index of the Jewish holiday or fast day for the current day, or a -1 if there is no holiday for this day. There are constants in this class representing each Yom Tov. Formatting of the Yomim tovim is done in theHebrewDateFormatter.formatYomTov(JewishCalendar)
.- Returns:
- the index of the holiday such as the constant
LAG_BAOMER
orYOM_KIPPUR
or a -1 if it is not a holiday. - See Also:
- TODO:
- Consider using enums instead of the constant ints.
-
isYomTov
Returns true if the current day is Yom Tov. The method returns true even for holidays such asCHANUKAH
and minor ones such asTU_BEAV
andPESACH_SHENI
. Erev Yom Tov (with the exception ofHOSHANA_RABBA
, erev the second days ofPESACH
) returns false, as dofast days
besidesYOM_KIPPUR
. UseisAssurBemelacha()
to find the days that have a prohibition of work.- Returns:
- true if the current day is a Yom Tov
- See Also:
-
isYomTovAssurBemelacha
Returns true if the Yom Tov day has a melacha (work) prohibition. This method will return false for a non-Yom Tov day, even if it is Shabbos.- Returns:
- if the Yom Tov day has a melacha (work) prohibition.
-
isAssurBemelacha
Returns true if it is Shabbos or if it is a Yom Tov day that has a melacha (work) prohibition.- Returns:
- if the day is a Yom Tov that is assur bemlacha or Shabbos
-
hasCandleLighting
Returns true if the day has candle lighting. This will return true on Erev Shabbos, Erev Yom Tov, the first day of Rosh Hashana and the first days of Yom Tov out of Israel. It is identical to callingisTomorrowShabbosOrYomTov()
.- Returns:
- if the day has candle lighting.
- See Also:
-
isTomorrowShabbosOrYomTov
Returns true if tomorrow is Shabbos or Yom Tov. This will return true on Erev Shabbos, Erev Yom Tov, the first day of Rosh Hashana and erev the first days of Yom Tov out of Israel. It is identical to callinghasCandleLighting()
.- Returns:
- will return if the next day is Shabbos or Yom Tov.
- See Also:
-
isErevYomTovSheni
Returns true if the day is the second day of Yom Tov. This impacts the second day of Rosh Hashana everywhere and the second days of Yom Tov in chutz laaretz (out of Israel).- Returns:
- if the day is the second day of Yom Tov.
-
isAseresYemeiTeshuva
Returns true if the current day is Aseres Yemei Teshuva.- Returns:
- if the current day is Aseres Yemei Teshuvah
-
isPesach
Returns true if the current day is Pesach (either the Yom Tov of Pesach orChol Hamoed Pesach).- Returns:
- true if the current day is Pesach (either the Yom Tov of Pesach orChol Hamoed Pesach).
- See Also:
-
isCholHamoedPesach
Returns true if the current day is Chol Hamoed of Pesach.- Returns:
- true if the current day is Chol Hamoed of Pesach
- See Also:
-
isShavuos
Returns true if the current day is Shavuos.- Returns:
- true if the current day is Shavuos.
- See Also:
-
isRoshHashana
Returns true if the current day is Rosh Hashana.- Returns:
- true if the current day is Rosh Hashana.
- See Also:
-
isYomKippur
Returns true if the current day is Yom Kippur.- Returns:
- true if the current day is Yom Kippur.
- See Also:
-
isSuccos
Returns true if the current day is Succos (either the Yom Tov of Succos orChol Hamoed Succos). It will return false forShmini Atzeres
andSimchas Torah
.- Returns:
- true if the current day is Succos (either the Yom Tov of Succos orChol Hamoed Succos.
- See Also:
-
isHoshanaRabba
Returns true if the current day is Hoshana Rabba.- Returns:
- true true if the current day is Hoshana Rabba.
- See Also:
-
isShminiAtzeres
Returns true if the current day is Shmini Atzeres.- Returns:
- true if the current day is Shmini Atzeres.
- See Also:
-
isSimchasTorah
Returns true if the current day is Simchas Torah. This will always return false ifin Israel
- Returns:
- true if the current day is Shmini Atzeres.
- See Also:
-
isCholHamoedSuccos
Returns true if the current day is Chol Hamoed of Succos.- Returns:
- true if the current day is Chol Hamoed of Succos
- See Also:
-
isCholHamoed
Returns true if the current day is Chol Hamoed of Pesach or Succos.- Returns:
- true if the current day is Chol Hamoed of Pesach or Succos
- See Also:
-
isErevYomTov
Returns true if the current day is Erev Yom Tov. The method returns true for Erev - Pesach (first and last days), Shavuos, Rosh Hashana, Yom Kippur, Succos and Hoshana Rabba.- Returns:
- true if the current day is Erev - Pesach, Shavuos, Rosh Hashana, Yom Kippur, Succos and Hoshana Rabba.
- See Also:
-
isErevRoshChodesh
Returns true if the current day is Erev Rosh Chodesh. Returns false for Erev Rosh Hashana.- Returns:
- true if the current day is Erev Rosh Chodesh. Returns false for Erev Rosh Hashana.
- See Also:
-
isYomKippurKatan
Returns true if the current day is Yom Kippur Katan. Returns false for Erev Rosh Hashana, Erev Rosh Chodesh Cheshvan, Teves and Iyyar. If Erev Rosh Chodesh occurs on a Friday or Shabbos, Yom Kippur Katan is moved back to Thursday.- Returns:
- true if the current day is Erev Rosh Chodesh. Returns false for Erev Rosh Hashana.
- See Also:
-
isBeHaB
The Monday, Thursday and Monday after the first Shabbos afterRosh Chodesh
Cheshvan
andIyar
are BeHaB days. If the last Monday of Iyar's BeHaB coincides withPesach Sheni
, the method currently considers it both Pesach Sheni and BeHaB. As seen in an Ohr Sameach article on the subject The unknown Days: BeHaB Vs. Pesach Sheini? there are some customs that delay the day to various points in the future.- Returns:
- true if the day is BeHaB.
-
isTaanis
Return true if the day is a Taanis (fast day). Return true for 17 of Tammuz, Tisha B'Av, Yom Kippur, Fast of Gedalyah, 10 of Teves and the Fast of Esther.- Returns:
- true if today is a fast day
-
isTaanisBechoros
Return true if the day is Taanis Bechoros (on Erev Pesach). It will return true for the 14th of Nissan if it is not on Shabbos, or if the 12th of Nissan occurs on a Thursday.- Returns:
- true if today is Taanis Bechoros.
-
getDayOfChanukah
Returns the day of Chanukah or -1 if it is not Chanukah.- Returns:
- the day of Chanukah or -1 if it is not Chanukah.
- See Also:
-
isChanukah
Returns true if the current day is one of the 8 days of Chanukah.- Returns:
- if the current day is one of the 8 days of Chanukah.
- See Also:
-
isPurim
Returns if the day is Purim (Shushan Purim in a mukaf choma and regular Purim in a non-mukaf choma).- Returns:
- if the day is Purim (Shushan Purim in a mukaf choma and regular Purin in a non-mukaf choma)
- See Also:
-
isRoshChodesh
Returns if the day is Rosh Chodesh. Rosh Hashana will return false- Returns:
- true if it is Rosh Chodesh. Rosh Hashana will return false
-
isMacharChodesh
Returns if the day is Shabbos and Sunday is Rosh Chodesh.- Returns:
- true if it is Shabbos and Sunday is Rosh Chodesh.
- TODO:
- There is more to tweak in this method (it does not cover all cases and opinions), and it may be removed.
-
isShabbosMevorchim
Returns if the day is Shabbos Mevorchim.- Returns:
- true if it is Shabbos Mevorchim.
-
getDayOfOmer
Returns the int value of the Omer day or -1 if the day is not in the Omer.- Returns:
- The Omer count as an int or -1 if it is not a day of the Omer.
-
isTishaBav
Returns if the day is Tisha Be'Av (the 9th of Av).- Returns:
- if the day is Tisha Be'Av (the 9th of Av).
-
getMoladAsDate
Returns the molad in Standard Time in Yerushalayim as a Date. The traditional calculation uses local time. This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the local time (of Har Habayis with a longitude of 35.2354° is 5.2354° away from the %15 timezone longitude) to get to standard time. This method intentionally uses standard time and not daylight savings time. Java will implicitly format the time to the default (or set) Timezone.- Returns:
- the Date representing the moment of the molad in Yerushalayim standard time (GMT + 2)
-
getTchilasZmanKidushLevana3Days
Returns the earliest time of Kiddush Levana calculated as 3 days after the molad. This method returns the time even if it is during the day when Kiddush Levana can't be said. Callers of this method should consider displaying the next tzais if the zman is between alos and tzais.- Returns:
- the Date representing the moment 3 days after the molad.
- See Also:
-
getTchilasZmanKidushLevana7Days
Returns the earliest time of Kiddush Levana calculated as 7 days after the molad as mentioned by the Mechaber. See the Bach's opinion on this time. This method returns the time even if it is during the day when Kiddush Levana can't be said. Callers of this method should consider displaying the next tzais if the zman is between alos and tzais.- Returns:
- the Date representing the moment 7 days after the molad.
- See Also:
-
getSofZmanKidushLevanaBetweenMoldos
Returns the latest time of Kiddush Levana according to the Maharil's opinion that it is calculated as halfway between molad and molad. This adds half the 29 days, 12 hours and 793 chalakim time between molad and molad (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's molad. This method returns the time even if it is during the day when Kiddush Levana can't be recited. Callers of this method should consider displaying alos before this time if the zman is between alos and tzais.- Returns:
- the Date representing the moment halfway between molad and molad.
- See Also:
-
getSofZmanKidushLevana15Days
Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the opinion brought down in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the Rema who brings down the the Maharil's opinion of calculating it ashalf way between molad and molad
is of the opinion of the Mechaber as well. Also see the Aruch Hashulchan. For additional details on the subject, See Rabbi Dovid Heber's very detailed writeup in Siman Daled (chapter 4) of Shaarei Zmanim. This method returns the time even if it is during the day when Kiddush Levana can't be said. Callers of this method should consider displaying alos before this time if the zman is between alos and tzais.- Returns:
- the Date representing the moment 15 days after the molad.
- See Also:
-
getDafYomiBavli
Returns the Daf Yomi (Bavli) for the date that the calendar is set to. See theHebrewDateFormatter.formatDafYomiBavli(Daf)
for the ability to format the daf in Hebrew or transliterated masechta names.- Returns:
- the daf as a
Daf
-
getDafYomiYerushalmi
Returns the Daf Yomi (Yerushalmi) for the date that the calendar is set to. See theHebrewDateFormatter.formatDafYomiYerushalmi(Daf)
for the ability to format the daf in Hebrew or transliterated masechta names.- Returns:
- the daf as a
Daf
-
getTekufasTishreiElapsedDays
Returns the elapsed days since Tekufas Tishrei. This uses Tekufas Shmuel (identical to the Julian Year with a solar year length of 365.25 days). The notation used below is D = days, H = hours and C = chalakim. Molad BaHaRad was 2D,5H,204C or 5H,204C from the start of Rosh Hashana year 1. For molad Nissan add 177D, 4H and 438C (6 * 29D, 12H and 793C), or 177D,9H,642C after Rosh Hashana year 1. Tekufas Nissan was 7D, 9H and 642C before molad Nissan according to the Rambam, or 170D, 0H and 0C after Rosh Hashana year 1. Tekufas Tishrei was 182D and 3H (365.25 / 2) before tekufas Nissan, or 12D and 15H before Rosh Hashana of year 1. Outside of Israel we start reciting Tal Umatar in Birkas Hashanim from 60 days after tekufas Tishrei. The 60 days include the day of the tekufah and the day we start reciting Tal Umatar. 60 days from the tekufah == 47D and 9H from Rosh Hashana year 1.- Returns:
- the number of elapsed days since tekufas Tishrei.
- See Also:
-
isVeseinTalUmatarStartDate
Deprecated.UseTefilaRules.isVeseinTalUmatarStartDate(JewishCalendar)
instead. This method will be removed in the v3.0 release.Returns if it is the Jewish day (starting the evening before) to start reciting Vesein Tal Umatar Livracha (Sheailas Geshamim). In Israel this is the 7th day of Marcheshvan. Outside Israel recitation starts on the evening of December 4th (or 5th if it is the year before a civil leap year) in the 21st century and shifts a day forward every century not evenly divisible by 400. This method will return true if vesein tal umatar on the current Jewish date that starts on the previous night, so Dec 5/6 will be returned by this method in the 21st century. vesein tal umatar is not recited on Shabbos and the start date will be delayed a day when the start day is on a Shabbos (this can only occur out of Israel).- Returns:
- true if it is the first Jewish day (starting the prior evening of reciting Vesein Tal Umatar Livracha (Sheailas Geshamim)).
- See Also:
-
isVeseinTalUmatarStartingTonight
Deprecated.UseTefilaRules.isVeseinTalUmatarStartingTonight(JewishCalendar)
instead. This method will be removed in the v3.0 release.Returns true if tonight is the first night to start reciting Vesein Tal Umatar Livracha ( Sheailas Geshamim). In Israel this is the 7th day of Marcheshvan (so the 6th will return true). Outside Israel recitation starts on the evening of December 4th (or 5th if it is the year before a civil leap year) in the 21st century and shifts a day forward every century not evenly divisible by 400. Vesein tal umatar is not recited on Shabbos and the start date will be delayed a day when the start day is on a Shabbos (this can only occur out of Israel).- Returns:
- true if it is the first Jewish day (starting the prior evening of reciting Vesein Tal Umatar Livracha (Sheailas Geshamim)).
- See Also:
-
isVeseinTalUmatarRecited
Deprecated.UseTefilaRules.isVeseinTalUmatarRecited(JewishCalendar)
instead. This method will be removed in the v3.0 release.Returns if Vesein Tal Umatar Livracha (Sheailas Geshamim) is recited. This will return true for the entire season, even on Shabbos when it is not recited.- Returns:
- true if Vesein Tal Umatar Livracha (Sheailas Geshamim) is recited.
- See Also:
-
isVeseinBerachaRecited
Deprecated.UseTefilaRules.isVeseinBerachaRecited(JewishCalendar)
instead. This method will be removed in the v3.0 release.Returns if Vesein Beracha is recited. It is recited from 15 Nissan to the point thatvesein tal umatar is recited
.- Returns:
- true if Vesein Beracha is recited.
- See Also:
-
isMashivHaruachStartDate
Deprecated.UseTefilaRules.isMashivHaruachStartDate(JewishCalendar)
instead. This method will be removed in the v3.0 release.Returns if the date is the start date for reciting Mashiv Haruach Umorid Hageshem. The date is 22 Tishrei.- Returns:
- true if the date is the start date for reciting Mashiv Haruach Umorid Hageshem.
- See Also:
-
isMashivHaruachEndDate
Deprecated.UseTefilaRules.isMashivHaruachEndDate(JewishCalendar)
instead. This method will be removed in the v3.0 release.Returns if the date is the end date for reciting Mashiv Haruach Umorid Hageshem. The date is 15 Nissan.- Returns:
- true if the date is the end date for reciting Mashiv Haruach Umorid Hageshem.
- See Also:
-
isMashivHaruachRecited
Deprecated.UseTefilaRules.isMashivHaruachRecited(JewishCalendar)
instead. This method will be removed in the v3.0 release.Returns if Mashiv Haruach Umorid Hageshem is recited. This period starts on 22 Tishrei and ends on the 15th day of Nissan.- Returns:
- true if Mashiv Haruach Umorid Hageshem is recited.
- See Also:
-
isMoridHatalRecited
Deprecated.UseTefilaRules.isMoridHatalRecited(JewishCalendar)
instead. This method will be removed in the v3.0 release.Returns if Morid Hatal (or the lack of reciting Mashiv Haruach following nussach Ashkenaz) is recited. This period starts on 22 Tishrei and ends on the 15th day of Nissan.- Returns:
- true if Morid Hatal (or the lack of reciting Mashiv Haruach following nussach Ashkenaz) is recited.
-
isIsruChag
Returns true if the current day is Isru Chag. The method returns true for the day following Pesach Shavuos and Succos. It utilizes to return the proper date.- Returns:
- true if the current day is Isru Chag. The method returns true for the day following Pesach Shavuos and Succos. It utilizes to return the proper date.
-
equals
Indicates whether some other object is "equal to" this one.- Overrides:
equals
in classJewishDate
- See Also:
-
hashCode
OverridesObject.hashCode()
.- Overrides:
hashCode
in classJewishDate
- See Also:
-
TefilaRules.isMashivHaruachEndDate(JewishCalendar)
instead.