Class JewishCalendar

java.lang.Object
com.kosherjava.zmanim.hebrewcalendar.JewishDate
com.kosherjava.zmanim.hebrewcalendar.JewishCalendar
All Implemented Interfaces:
Cloneable, Comparable<JewishDate>

public class JewishCalendar extends 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.
Author:
© Y. Paritcher 2019 - 2022, © Avrom Finkelstien 2002, © Moshe Dicker 2026, © Eliyahu Hershfeld 2011 - 2026
See Also:
TODO:
Some do not belong in this class, but here is a partial list of what should still be implemented in some form:
  1. Mishna yomis etc
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    List of parshiyos or special Shabasos.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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 Pesach (Passover).
    static final int
    Erev Rosh Hashana (the day before Rosh Hashana), the 29th of Elul
    static final int
    Erev Shavuos (the day before Shavuos), the 5th of Sivan
    static 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 and second days of Tishrei.
    static final int
    The fast of the 17th day of Tammuz
    static final int
    Shavuos (Pentecost), the 6th of Sivan
    static 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 celebrated out 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 Tishrei
    static final int
    The fast of the 10th day of Teves.
    static final int
    The fast of the 9th of Av
    static final int
    The 15th day of Av, a minor holiday
    static 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 Tishrei
    static 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.

    Fields inherited from class JewishDate

    ADAR, ADAR_II, AV, CHASERIM, CHESHVAN, ELUL, IYAR, KESIDRAN, KISLEV, NISSAN, SHELAIMIM, SHEVAT, SIVAN, TAMMUZ, TEVES, TISHREI
    Modifier and Type
    Field
    Description
    static final int
    Value of the month field indicating Adar (or Adar I in a leap year), the twelfth numeric month of the year in the Jewish calendar.
    static final int
    Value of the month field indicating Adar II, the leap (intercalary or embolismic) thirteenth (Undecimber) numeric month of the year added in Jewish leap year).
    static final int
    Value of the month field indicating Av, the fifth numeric month of the year in the Jewish calendar.
    static final int
    A short year where both JewishDate.CHESHVAN and JewishDate.KISLEV are 29 days.
    static final int
    Value of the month field indicating Cheshvan/marcheshvan, the eighth numeric month of the year in the Jewish calendar.
    static final int
    Value of the month field indicating Elul, the sixth numeric month of the year in the Jewish calendar.
    static final int
    Value of the month field indicating Iyar, the second numeric month of the year in the Jewish calendar.
    static final int
    An ordered year where JewishDate.CHESHVAN is 29 days and JewishDate.KISLEV is 30 days.
    static final int
    Value of the month field indicating Kislev, the ninth numeric month of the year in the Jewish calendar.
    static final int
    Value of the month field indicating Nissan, the first numeric month of the year in the Jewish calendar.
    static final int
    A long year where both JewishDate.CHESHVAN and JewishDate.KISLEV are 30 days.
    static final int
    Value of the month field indicating Shevat, the eleventh numeric month of the year in the Jewish calendar.
    static final int
    Value of the month field indicating Sivan, the third numeric month of the year in the Jewish calendar.
    static final int
    Value of the month field indicating Tammuz, the fourth numeric month of the year in the Jewish calendar.
    static final int
    Value of the month field indicating Teves, the tenth numeric month of the year in the Jewish calendar.
    static final int
    Value of the month field indicating Tishrei, the seventh numeric month of the year in the Jewish calendar.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default 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 Israel
    A constructor that initializes the date to the LocalDate parameter.
    A constructor that initializes the date to the Calendar parameter.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object object)
    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's Parsha 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 a Parsha enum if the Shabbos is one of the four parshiyos of Shkalim, Zachor, Para, Hachdesh, or five other special Shabbasos of Hagadol, Chazon, Nachamu, Shuva, Shira, or Parsha.NONE for a regular Shabbos (or any weekday).
    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 upcoming Parsha 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
    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
    The Monday, Thursday and Monday after the first Shabbos after Rosh Chodesh Cheshvan and Iyar 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
    Returns true if the current day is Pesach (either the Yom Tov of Pesach orChol Hamoed Pesach).
    boolean
    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
    Returns true if the current day is Succos (either the Yom Tov of Succos orChol Hamoed Succos).
    boolean
    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
    Returns true if the current day is Yom Kippur.
    boolean
    Returns true if the current day is Yom Kippur Katan.
    boolean
    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 JewishDate

    clone, compareTo, getAbsDate, getChalakimSinceMoladTohu, getCheshvanKislevKviah, getDayOfWeek, getDaysInJewishMonth, getDaysInJewishYear, getDaysInJewishYear, getDaysSinceStartOfJewishYear, getJewishCalendarElapsedDays, getJewishDayOfMonth, getJewishMonth, getJewishYear, getLocalDate, getMolad, getMoladChalakim, getMoladHours, getMoladMinutes, isCheshvanLong, isJewishLeapYear, isKislevShort, minusDays, minusMonths, minusYears, plusDays, plusMonths, plusYears, resetDate, setGregorianDate, setGregorianDate, setJewishDate, setJewishDate, setJewishDayOfMonth, setJewishMonth, setJewishYear, setMoladChalakim, setMoladHours, setMoladMinutes, toString
    Modifier and Type
    Method
    Description
    A method that creates a deep copy of the object.
    int
    compareTo(JewishDate jewishDate)
    Compares two dates as per the compareTo() method in the Comparable interface.
    int
    Returns the absolute date (days since January 1, 0001 of the Gregorian calendar).
    long
    Returns the number of chalakim (parts - 1080 to the hour) from the original hypothetical Molad Tohu to the Jewish year and month that this Object is set to.
    int
    Returns the Cheshvan and Kislev kviah (whether a Jewish year is short, regular or long).
    int
    Returns the day of the week as a number between 1-7.
    int
    Returns the number of days of the Jewish month that the calendar is currently set to.
    int
    Returns the number of days for the current year that the calendar is set to.
    static int
    Returns the number of days for a given Jewish year.
    int
    returns the number of days from Rosh Hashana of the date passed in, to the full date passed in.
    static int
    Returns the number of days elapsed from the Sunday prior to the start of the Jewish calendar to the mean conjunction of Tishri of the Jewish year.
    int
    Returns the Jewish day of month.
    int
    Returns the Jewish month 1-12 (or 13 years in a leap year).
    int
    Returns the Jewish year.
    Returns this object's date as a LocalDate object.
    Returns the molad for a given year and month.
    int
    Returns the molad chalakim / parts.
    int
    Returns the molad hours.
    int
    Returns the molad minutes.
    boolean
    Returns if Cheshvan is long (30 days VS 29 days) for the current year that the calendar is set to.
    boolean
    Returns if the year the calendar is set to is a Jewish leap year.
    boolean
    Returns if the Kislev is short for the year that this class is set to.
    void
    minusDays(int days)
    Subtracts the number of days passed in from the currently set date.
    void
    minusMonths(int months)
    Subtracts the number of months passed in to the currently set date.
    void
    minusYears(int years, boolean useAdarAlephForLeapYear)
    Subtract the number of years passed in to the currently set date.
    void
    plusDays(int days)
    Add the number of days passed in to the currently set date.
    void
    plusMonths(int months)
    Add the number of months passed in to the currently set date.
    void
    plusYears(int years, boolean useAdarAlephForLeapYear)
    Add the number of years passed in to the currently set date.
    void
    Resets this date to the current system date.
    void
    Sets the date based on a LocalDate object.
    void
    Sets the date based on a ZonedDateTime object.
    void
    setJewishDate(int year, int month, int dayOfMonth)
    Sets the Jewish Date and updates the Gregorian date accordingly.
    void
    setJewishDate(int year, int month, int dayOfMonth, int hours, int minutes, int chalakim)
    Sets the Jewish Date and updates the Gregorian date accordingly.
    void
    setJewishDayOfMonth(int dayOfMonth)
    Setter for the Jewish day of the month that will be clamped to the lesser of the number passed in or the max number of days in the month.
    void
    setJewishMonth(int month)
    Setter for the Jewish month that is passed in.
    void
    setJewishYear(int year)
    Setter for the Jewish year of the passed in that will clamp the day to the month to the lesser of the current day and the max number of days in the month (if set to the 30th).
    void
    setMoladChalakim(int moladChalakim)
    Sets the molad chalakim/parts.
    void
    setMoladHours(int moladHours)
    Sets the molad hours.
    void
    setMoladMinutes(int moladMinutes)
    Sets the molad minutes.
    Returns a string containing the Jewish date in the form, "day Month, year" e.g. "21 Shevat, 5729".

    Methods inherited from class Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • JewishCalendar

      public JewishCalendar()
      Default constructor will set a default date to the current system date.
    • JewishCalendar

      public JewishCalendar(ZonedDateTime zonedDateTime)
      A constructor that initializes the date to the Calendar parameter.
      Parameters:
      zonedDateTime - the ZonedDateTime to set the calendar to
    • JewishCalendar

      public JewishCalendar(LocalDate localDate)
      A constructor that initializes the date to the LocalDate parameter.
      Parameters:
      localDate - the LocalDate to set the calendar to
    • JewishCalendar

      public JewishCalendar(int jewishYear, int jewishMonth, int jewishDayOfMonth)
      Creates a Jewish date based on a Jewish year, month and day of month.
      Parameters:
      jewishYear - the Jewish year
      jewishMonth - the Jewish month. The method expects a 1 for Nissan ... 12 for Adar and 13 for Adar II. Use the constants JewishDate.NISSAN ... JewishDate.ADAR (or JewishDate.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 example JewishDate.IYAR, or JewishDate.KISLEV in a year that JewishDate.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

      public JewishCalendar(int jewishYear, int jewishMonth, int jewishDayOfMonth, boolean inIsrael)
      Creates a Jewish date based on a Jewish date and whether in Israel
      Parameters:
      jewishYear - the Jewish year
      jewishMonth - the Jewish month. The method expects a 1 for Nissan ... 12 for Adar and 13 for Adar II. Use the constants JewishDate.NISSAN ... JewishDate.ADAR (or JewishDate.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 example JewishDate.IYAR, or JewishDate.KISLEV in a year that JewishDate.isKislevShort()), the 29th (last valid date of the month) will be set.
      inIsrael - whether in Israel. This affects Yom Tov calculations
  • Method Details

    • isUseModernHolidays

      public boolean isUseModernHolidays()
      Is this calendar set to return modern Israeli national holidays. By default, this value is false. The holidays are Yom HaShoah, Yom Hazikaron, Yom Ha'atzmaut and Yom Yerushalayim.
      Returns:
      the useModernHolidays true if set to return modern Israeli national holidays
      See Also:
    • setUseModernHolidays

      public void setUseModernHolidays(boolean useModernHolidays)
      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 and Yom Yerushalayim.
      Parameters:
      useModernHolidays - the useModernHolidays to set
      See Also:
    • setInIsrael

      public void setInIsrael(boolean inIsrael)
      Sets whether to use Israel holiday scheme or not. Default is false.
      Parameters:
      inIsrael - set to true for calculations for Israel
      See Also:
    • getInIsrael

      public boolean 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

      public boolean 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

      public 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. 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

      public boolean 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

      private int 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's Parsha if it is Shabbos. It returns JewishCalendar.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 upcoming Parsha regardless of if it is the weekday or Shabbos (where next Shabbos's Parsha will be returned. This is unlike getParshah() that returns JewishCalendar.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 a Parsha enum if the Shabbos is one of the four parshiyos of Shkalim, Zachor, Para, Hachdesh, or five other special Shabbasos of Hagadol, Chazon, Nachamu, Shuva, Shira, or Parsha.NONE for a regular Shabbos (or any weekday).
      Returns:
      one of the four parshiyos of Shkalim, Zachor, Para, Hachodesh, or five other special Shabbasos of Hagadol, Chazon, Nachamu, Shuva, Shira, or Parsha.NONE for a regular Shabbos (or any weekday).
    • getYomTovIndex

      public int 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 the HebrewDateFormatter.formatYomTov(JewishCalendar).
      Returns:
      the index of the holiday such as the constant LAG_BAOMER or YOM_KIPPUR or a -1 if it is not a holiday.
      See Also:
      TODO:
      Consider using enums instead of the constant ints.
    • isYomTov

      public boolean isYomTov()
      Returns true if the current day is Yom Tov. The method returns true even for holidays such as CHANUKAH and minor ones such as TU_BEAV and PESACH_SHENI. Erev Yom Tov (with the exception of HOSHANA_RABBA and erev the second days of PESACH) returns false, as do fast days besides YOM_KIPPUR. Use isAssurBemelacha() to find the days that have a prohibition of work.
      Returns:
      true if the current day is a Yom Tov
      See Also:
    • isYomTovAssurBemelacha

      public boolean 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

      public boolean 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

      public boolean 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 calling isTomorrowShabbosOrYomTov().
      Returns:
      if the day has candle lighting.
      See Also:
    • isTomorrowShabbosOrYomTov

      public boolean 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 calling hasCandleLighting().
      Returns:
      will return if the next day is Shabbos or Yom Tov.
      See Also:
    • isErevYomTovSheni

      public boolean 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

      public boolean isAseresYemeiTeshuva()
      Returns true if the current day is Aseres Yemei Teshuva.
      Returns:
      if the current day is Aseres Yemei Teshuva
    • isPesach

      public boolean 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

      public boolean 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

      public boolean isShavuos()
      Returns true if the current day is Shavuos.
      Returns:
      true if the current day is Shavuos.
      See Also:
    • isRoshHashana

      public boolean isRoshHashana()
      Returns true if the current day is Rosh Hashana.
      Returns:
      true if the current day is Rosh Hashana.
      See Also:
    • isYomKippur

      public boolean isYomKippur()
      Returns true if the current day is Yom Kippur.
      Returns:
      true if the current day is Yom Kippur.
      See Also:
    • isSuccos

      public boolean isSuccos()
      Returns true if the current day is Succos (either the Yom Tov of Succos orChol Hamoed Succos). It will return false for Shmini Atzeres and Simchas Torah.
      Returns:
      true if the current day is Succos (either the Yom Tov of Succos orChol Hamoed Succos.
      See Also:
    • isHoshanaRabba

      public boolean isHoshanaRabba()
      Returns true if the current day is Hoshana Rabba.
      Returns:
      true if the current day is Hoshana Rabba.
      See Also:
    • isShminiAtzeres

      public boolean isShminiAtzeres()
      Returns true if the current day is Shmini Atzeres.
      Returns:
      true if the current day is Shmini Atzeres.
      See Also:
    • isSimchasTorah

      public boolean isSimchasTorah()
      Returns true if the current day is Simchas Torah. This will always return false if in Israel
      Returns:
      true if the current day is Shmini Atzeres.
      See Also:
    • isCholHamoedSuccos

      public boolean 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

      public boolean 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

      public boolean 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

      public boolean 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

      public boolean 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

      public boolean isBeHaB()
      The Monday, Thursday and Monday after the first Shabbos after Rosh Chodesh Cheshvan and Iyar are BeHaB days. If the last Monday of Iyar's BeHaB coincides with Pesach 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

      public boolean 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

      public boolean 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

      public int 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

      public boolean 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

      public boolean 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 Purim in a non-mukaf choma)
      See Also:
    • isRoshChodesh

      public boolean 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

      public boolean 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

      public boolean isShabbosMevorchim()
      Returns if the day is Shabbos Mevorchim.
      Returns:
      true if it is Shabbos Mevorchim.
    • getDayOfOmer

      public int 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

      public boolean 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).
    • getMoladAsInstant

      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 Maharil's opinion of calculating it as half 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

      public Daf getDafYomiBavli()
      Returns the Daf Yomi (Bavli) for the date that the calendar is set to. See the HebrewDateFormatter.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 the HebrewDateFormatter.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:
    • isIsruChag

      public boolean 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

      public boolean equals(Object object)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class JewishDate
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class JewishDate
      See Also: