Class HebrewDateFormatter

java.lang.Object
com.kosherjava.zmanim.hebrewcalendar.HebrewDateFormatter

public class HebrewDateFormatter
extends Object
The HebrewDateFormatter class formats a JewishDate. The class formats Jewish dates, numbers, Daf Yomi (Bavli and Yerushalmi), the Omer, Parshas Hashavua (including special parshiyos such as Shekalim, Zachor, Parah, Hachodesh), Yomim Tovim and the Molad (experimental) in Hebrew or Latin chars, and has various settings. Sample full date output includes (using various options):
  • 21 Shevat, 5729
  • כא שבט תשכט
  • כ״א שבט ה׳תשכ״ט
  • כ״א שבט תש״פ or כ״א שבט תש״ף
  • כ׳ שבט ו׳ אלפים
Author:
© Eliyahu Hershfeld 2011 - 2020
See Also:
JewishDate, JewishCalendar
  • Field Summary

    Fields
    Modifier and Type Field Description
    private static String GERESH
    The gersh character is the ׳ char that is similar to a single quote and is used in formatting Hebrew numbers.
    private static String GERSHAYIM
    The gershyim character is the ״ char that is similar to a double quote and is used in formatting Hebrew numbers.
    private static String[] hebrewDaysOfWeek
    Unicode list of Hebrew days of week in the format of ["ראשון", "שני","שלישי","רביעי", "חמישי","ששי","שבת"]
    private boolean hebrewFormat
    private String[] hebrewHolidays
    Hebrew holiday array in the following format
    ["ערב פסח", "פסח", "חול המועד פסח", "פסח שני", "ערב שבועות", "שבועות", "שבעה עשר בתמוז", "תשעה באב", "ט״ו באב", "ערב ראש השנה", "ראש השנה", "צום גדליה", "ערב יום כיפור", "יום כיפור", "ערב סוכות", "סוכות", "חול המועד סוכות", "הושענא רבה", "שמיני עצרת", "שמחת תורה", "ערב חנוכה", "חנוכה", "עשרה בטבת", "ט״ו בשבט", "תענית אסתר", "פורים", "פורים שושן", "פורים קטן", "ראש חודש", "יום השואה", "יום הזיכרון", "יום העצמאות", "יום ירושלים", "ל״ג בעומר", "פורים שושן קטן"]
    private static String[] hebrewMonths
    Unicode list of Hebrew months in the format of ["ניסן","אייר", "סיון","תמוז","אב","אלול", "תשרי","חשון","כסלו","טבת", "שבט","אדר","אדר ב","אדר א"]
    private String hebrewOmerPrefix
    The Hebrew omer prefix charachter.
    private EnumMap<JewishCalendar.Parsha,​String> hebrewParshaMap
    Unicode EnumMap of Hebrew parshiyos.  the The list includes double and special parshiyos and contains "בראשית, נח, לך לך, וירא, חיי שרה, תולדות, ויצא, וישלח, וישב, מקץ, ויגש, ויחי, שמות, וארא, בא, בשלח, יתרו, משפטים, תרומה, תצוה, כי תשא, ויקהל, פקודי, ויקרא, צו, שמיני, תזריע, מצרע, אחרי מות, קדושים, אמור, בהר, בחקתי, במדבר, נשא, בהעלתך, שלח לך, קרח, חוקת, בלק, פינחס, מטות, מסעי, דברים, ואתחנן, עקב, ראה, שופטים, כי תצא, כי תבוא, ניצבים, וילך, האזינו, וזאת הברכה, ויקהל פקודי, תזריע מצרע, אחרי מות קדושים, בהר בחקתי, חוקת בלק, מטות מסעי, ניצבים וילך, שקלים, זכור, פרה, החדש"
    private boolean longWeekFormat
    private String[] transliteratedHolidays
    private String[] transliteratedMonths
    Transliterated month names.  Defaults to ["Nissan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Cheshvan", "Kislev", "Teves", "Shevat", "Adar", "Adar II", "Adar I" ].
    private EnumMap<JewishCalendar.Parsha,​String> transliteratedParshaMap
    List of transliterated parshiyos using the default Ashkenazi pronounciation.  The formatParsha method uses this for transliterated parsha formatting.  This list can be overridden (for Sephardi English transliteration for example) by setting the setTransliteratedParshiosList(EnumMap).  The list includes double and special parshiyos is set as "Bereshis, Noach, Lech Lecha, Vayera, Chayei Sara, Toldos, Vayetzei, Vayishlach, Vayeshev, Miketz, Vayigash, Vayechi, Shemos, Vaera, Bo, Beshalach, Yisro, Mishpatim, Terumah, Tetzaveh, Ki Sisa, Vayakhel, Pekudei, Vayikra, Tzav, Shmini, Tazria, Metzora, Achrei Mos, Kedoshim, Emor, Behar, Bechukosai, Bamidbar, Nasso, Beha'aloscha, Sh'lach, Korach, Chukas, Balak, Pinchas, Matos, Masei, Devarim, Vaeschanan, Eikev, Re'eh, Shoftim, Ki Seitzei, Ki Savo, Nitzavim, Vayeilech, Ha'Azinu, Vezos Habracha, Vayakhel Pekudei, Tazria Metzora, Achrei Mos Kedoshim, Behar Bechukosai, Chukas Balak, Matos Masei, Nitzavim Vayeilech, Shekalim, Zachor, Parah, Hachodesh".
    private String transliteratedShabbosDayOfweek
    The default value for formatting Shabbos (Saturday).  Defaults to Shabbos.
    private boolean useFinalFormLetters
    private boolean useGershGershayim
    private boolean useLonghebrewYears
    private SimpleDateFormat weekFormat
    The internal DateFormat.  See isLongWeekFormat() and setLongWeekFormat(boolean).
  • Constructor Summary

    Constructors
    Constructor Description
    HebrewDateFormatter()
    Default constructor sets the EnumMaps of Hebrew and default transliterated parshiyos.
  • Method Summary

    Modifier and Type Method Description
    String format​(JewishDate jewishDate)
    Formats the Jewish date.
    String formatDafYomiBavli​(Daf daf)
    Formats the Daf Yomi Bavli in the format of "עירובין נ״ב" in Hebrew, or the transliterated format of "Eruvin 52".
    String formatDafYomiYerushalmi​(Daf daf)
    Formats the Daf Yomi Yerushalmi in the format of "עירובין נ״ב" in Hebrew, or the transliterated format of "Eruvin 52".
    String formatDayOfWeek​(JewishDate jewishDate)
    Formats the day of week.
    String formatHebrewNumber​(int number)
    Returns a Hebrew formatted string of a number.
    private static String formatMolad​(long moladChalakim)
    Formats a molad.
    String formatMonth​(JewishDate jewishDate)
    Returns a string of the current Hebrew month such as "Tishrei".
    String formatOmer​(JewishCalendar jewishCalendar)
    Returns a String of the Omer day in the form ל״ג בעומר if Hebrew Format is set, or "Omer X" or "Lag B'Omer" if not.
    String formatParsha​(JewishCalendar jewishCalendar)
    Returns a String with the name of the current parsha(ios).
    String formatRoshChodesh​(JewishCalendar jewishCalendar)
    Formats a day as Rosh Chodesh in the format of in the format of ראש חודש שבט or Rosh Chodesh Shevat.
    String formatSpecialParsha​(JewishCalendar jewishCalendar)
    Returns a String with the name of the current special parsha of Shekalim, Zachor, Parah or Hachodesh or an empty String for a non-special parsha.
    String formatYomTov​(JewishCalendar jewishCalendar)
    Formats the Yom Tov (holiday) in Hebrew or transliterated Latin characters.
    String getFormattedKviah​(int jewishYear)
    Returns the kviah in the traditional 3 letter Hebrew format where the first letter represents the day of week of Rosh Hashana, the second letter represents the lengths of Cheshvan and Kislev (Shelaimim , Kesidran or Chaserim) and the 3rd letter represents the day of week of Pesach.
    String getHebrewOmerPrefix()
    Returns the Hebrew Omer prefix.  By default it is the letter ב producing בעומר, but it can be set to ל to produce לעומר (or any other prefix) using the setHebrewOmerPrefix(String).
    String[] getTransliteratedHolidayList()
    Returns the list of holidays transliterated into Latin chars.
    String[] getTransliteratedMonthList()
    Returns the list of months transliterated into Latin chars.
    EnumMap<JewishCalendar.Parsha,​String> getTransliteratedParshiosList()
    Retruns the list of transliterated parshiyos used by this formatter.
    String getTransliteratedShabbosDayOfWeek()
    Returns the day of Shabbos transliterated into Latin chars.
    boolean isHebrewFormat()
    Returns if the formatter is set to use Hebrew formatting in the various formatting methods.
    boolean isLongWeekFormat()
    Returns if the formatDayOfWeek(JewishDate) will use the long format such as ראשון or short such as א when formatting the day of week in Hebrew.
    boolean isUseFinalFormLetters()
    Returns whether the class is set to use the מנצפ״ך letters when formatting years ending in 20, 40, 50, 80 and 90 to produce תש״פ if false or or תש״ף if true.
    boolean isUseGershGershayim()
    Returns whether the class is set to use the Geresh ׳ and Gershayim ״ in formatting Hebrew dates and numbers.
    boolean isUseLongHebrewYears()
    Returns whether the class is set to use the thousands digit when formatting.
    void setHebrewFormat​(boolean hebrewFormat)
    Sets the formatter to format in Hebrew in the various formatting methods.
    void setHebrewOmerPrefix​(String hebrewOmerPrefix)
    Method to set the Hebrew Omer prefix.  By default it is the letter ב producing בעומר, but it can be set to ל to produce לעומר (or any other prefix)
    void setLongWeekFormat​(boolean longWeekFormat)
    Setting to control if the formatDayOfWeek(JewishDate) will use the long format such as ראשון or short such as א when formatting the day of week in Hebrew.
    void setTransliteratedHolidayList​(String[] transliteratedHolidays)
    Sets the list of holidays transliterated into Latin chars.
    void setTransliteratedMonthList​(String[] transliteratedMonths)
    Setter method to allow overriding of the default list of months transliterated into into Latin chars.
    void setTransliteratedParshiosList​(EnumMap<JewishCalendar.Parsha,​String> transliteratedParshaMap)
    Setter method to allow overriding of the default list of parshiyos transliterated into into Latin chars.
    void setTransliteratedShabbosDayOfWeek​(String transliteratedShabbos)
    Setter to override the default transliterated name of "Shabbos" to alternate spelling such as "Shabbat" used by the formatDayOfWeek(JewishDate)
    void setUseFinalFormLetters​(boolean useFinalFormLetters)
    When formatting a Hebrew Year, traditionally years ending in 20, 40, 50, 80 and 90 are formatted using non-final form letters for example תש״פ for the year 5780.
    void setUseGershGershayim​(boolean useGershGershayim)
    Sets whether to use the Geresh ׳ and Gershayim ״ in formatting Hebrew dates and numbers.
    void setUseLongHebrewYears​(boolean useLongHebrewYears)
    When formatting a Hebrew Year, traditionally the thousands digit is omitted and output for a year such as 5729 (1969 Gregorian) would be calculated for 729 and format as תשכ״ט.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • HebrewDateFormatter

      Default constructor sets the EnumMaps of Hebrew and default transliterated parshiyos.
  • Method Details

    • isLongWeekFormat

      public boolean isLongWeekFormat()
      Returns if the formatDayOfWeek(JewishDate) will use the long format such as ראשון or short such as א when formatting the day of week in Hebrew.
      Returns:
      the longWeekFormat
      See Also:
      setLongWeekFormat(boolean), formatDayOfWeek(JewishDate)
    • setLongWeekFormat

      public void setLongWeekFormat​(boolean longWeekFormat)
      Setting to control if the formatDayOfWeek(JewishDate) will use the long format such as ראשון or short such as א when formatting the day of week in Hebrew.
      Parameters:
      longWeekFormat - the longWeekFormat to set
    • getTransliteratedShabbosDayOfWeek

      Returns the day of Shabbos transliterated into Latin chars. The default uses Ashkenazi pronunciation "Shabbos". This can be overwritten using the setTransliteratedShabbosDayOfWeek(String)
      Returns:
      the transliteratedShabbos. The default list of months uses Ashkenazi pronunciation "Shabbos".
      See Also:
      setTransliteratedShabbosDayOfWeek(String), formatDayOfWeek(JewishDate)
    • setTransliteratedShabbosDayOfWeek

      public void setTransliteratedShabbosDayOfWeek​(String transliteratedShabbos)
      Setter to override the default transliterated name of "Shabbos" to alternate spelling such as "Shabbat" used by the formatDayOfWeek(JewishDate)
      Parameters:
      transliteratedShabbos - the transliteratedShabbos to set
      See Also:
      getTransliteratedShabbosDayOfWeek(), formatDayOfWeek(JewishDate)
    • getTransliteratedHolidayList

      Returns the list of holidays transliterated into Latin chars. This is used by the formatYomTov(JewishCalendar) when formatting the Yom Tov String. The default list of months uses Ashkenazi pronunciation in typical American English spelling.
      Returns:
      the list of transliterated holidays. The default list is currently ["Erev Pesach", "Pesach", "Chol Hamoed Pesach", "Pesach Sheni", "Erev Shavuos", "Shavuos", "Seventeenth of Tammuz", "Tishah B'Av", "Tu B'Av", "Erev Rosh Hashana", "Rosh Hashana", "Fast of Gedalyah", "Erev Yom Kippur", "Yom Kippur", "Erev Succos", "Succos", "Chol Hamoed Succos", "Hoshana Rabbah", "Shemini Atzeres", "Simchas Torah", "Erev Chanukah", "Chanukah", "Tenth of Teves", "Tu B'Shvat", "Fast of Esther", "Purim", "Shushan Purim", "Purim Katan", "Rosh Chodesh", "Yom HaShoah", "Yom Hazikaron", "Yom Ha'atzmaut", "Yom Yerushalayim", "Lag B'Omer","Shushan Purim Katan"].
      See Also:
      setTransliteratedMonthList(String[]), formatYomTov(JewishCalendar), isHebrewFormat()
    • setTransliteratedHolidayList

      public void setTransliteratedHolidayList​(String[] transliteratedHolidays)
      Sets the list of holidays transliterated into Latin chars. This is used by the formatYomTov(JewishCalendar) when formatting the Yom Tov String.
      Parameters:
      transliteratedHolidays - the transliteratedHolidays to set. Ensure that the sequence exactly matches the list returned by the default
    • formatYomTov

      public String formatYomTov​(JewishCalendar jewishCalendar)
      Formats the Yom Tov (holiday) in Hebrew or transliterated Latin characters.
      Parameters:
      jewishCalendar - the JewishCalendar
      Returns:
      the formatted holiday or an empty String if the day is not a holiday.
      See Also:
      isHebrewFormat()
    • formatRoshChodesh

      public String formatRoshChodesh​(JewishCalendar jewishCalendar)
      Formats a day as Rosh Chodesh in the format of in the format of ראש חודש שבט or Rosh Chodesh Shevat. If it is not Rosh Chodesh, an empty String will be returned.
      Parameters:
      jewishCalendar - the JewishCalendar
      Returns:
      The formatted String in the format of ראש חודש שבט or Rosh Chodesh Shevat. If it is not Rosh Chodesh, an empty String will be returned.
    • isHebrewFormat

      public boolean isHebrewFormat()
      Returns if the formatter is set to use Hebrew formatting in the various formatting methods.
      Returns:
      the hebrewFormat
      See Also:
      setHebrewFormat(boolean), format(JewishDate), formatDayOfWeek(JewishDate), formatMonth(JewishDate), formatOmer(JewishCalendar), formatYomTov(JewishCalendar)
    • setHebrewFormat

      public void setHebrewFormat​(boolean hebrewFormat)
      Sets the formatter to format in Hebrew in the various formatting methods.
      Parameters:
      hebrewFormat - the hebrewFormat to set
      See Also:
      isHebrewFormat(), format(JewishDate), formatDayOfWeek(JewishDate), formatMonth(JewishDate), formatOmer(JewishCalendar), formatYomTov(JewishCalendar)
    • getHebrewOmerPrefix

      Returns the Hebrew Omer prefix.  By default it is the letter ב producing בעומר, but it can be set to ל to produce לעומר (or any other prefix) using the setHebrewOmerPrefix(String).
      Returns:
      the hebrewOmerPrefix
      See Also:
      hebrewOmerPrefix, setHebrewOmerPrefix(String), formatOmer(JewishCalendar)
    • setHebrewOmerPrefix

      public void setHebrewOmerPrefix​(String hebrewOmerPrefix)
      Method to set the Hebrew Omer prefix.  By default it is the letter ב producing בעומר, but it can be set to ל to produce לעומר (or any other prefix)
      Parameters:
      hebrewOmerPrefix - the hebrewOmerPrefix to set. You can use the Unicode \u05DC to set it to ל.
      See Also:
      hebrewOmerPrefix, getHebrewOmerPrefix(), formatOmer(JewishCalendar)
    • getTransliteratedMonthList

      Returns the list of months transliterated into Latin chars. The default list of months uses Ashkenazi pronunciation in typical American English spelling. This list has a length of 14 with 3 variations for Adar - "Adar", "Adar II", "Adar I"
      Returns:
      the list of months beginning in Nissan and ending in in "Adar", "Adar II", "Adar I". The default list is currently ["Nissan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Cheshvan", "Kislev", "Teves", "Shevat", "Adar", "Adar II", "Adar I"].
      See Also:
      setTransliteratedMonthList(String[])
    • setTransliteratedMonthList

      public void setTransliteratedMonthList​(String[] transliteratedMonths)
      Setter method to allow overriding of the default list of months transliterated into into Latin chars. The default uses Ashkenazi American English transliteration.
      Parameters:
      transliteratedMonths - an array of 14 month names that defaults to ["Nissan", "Iyar", "Sivan", "Tamuz", "Av", "Elul", "Tishrei", "Heshvan", "Kislev", "Tevet", "Shevat", "Adar", "Adar II", "Adar I"].
      See Also:
      getTransliteratedMonthList()
    • formatDayOfWeek

      public String formatDayOfWeek​(JewishDate jewishDate)
      Formats the day of week. If Hebrew formatting is set, it will display in the format ראשון etc. If Hebrew formatting is not in use it will return it in the format of Sunday etc. There are various formatting options that will affect the output.
      Parameters:
      jewishDate - the JewishDate Object
      Returns:
      the formatted day of week
      See Also:
      isHebrewFormat(), isLongWeekFormat()
    • isUseGershGershayim

      public boolean isUseGershGershayim()
      Returns whether the class is set to use the Geresh ׳ and Gershayim ״ in formatting Hebrew dates and numbers. When true and output would look like כ״א שבט תש״כ (or כ״א שבט תש״ך). When set to false, this output would display as כא שבט תשכ.
      Returns:
      true if set to use the Geresh ׳ and Gershayim ״ in formatting Hebrew dates and numbers.
    • setUseGershGershayim

      public void setUseGershGershayim​(boolean useGershGershayim)
      Sets whether to use the Geresh ׳ and Gershayim ״ in formatting Hebrew dates and numbers. The default value is true and output would look like כ״א שבט תש״כ (or כ״א שבט תש״ך). When set to false, this output would display as כא שבט תשכ (or כא שבט תשך). Single digit days or month or years such as כ׳ שבט ו׳ אלפים show the use of the Geresh.
      Parameters:
      useGershGershayim - set to false to omit the Geresh ׳ and Gershayim ״ in formatting
    • isUseFinalFormLetters

      public boolean isUseFinalFormLetters()
      Returns whether the class is set to use the מנצפ״ך letters when formatting years ending in 20, 40, 50, 80 and 90 to produce תש״פ if false or or תש״ף if true. Traditionally non-final form letters are used, so the year 5780 would be formatted as תש״פ if the default false is used here. If this returns true, the format תש״ף would be used.
      Returns:
      true if set to use final form letters when formatting Hebrew years. The default value is false.
    • setUseFinalFormLetters

      public void setUseFinalFormLetters​(boolean useFinalFormLetters)
      When formatting a Hebrew Year, traditionally years ending in 20, 40, 50, 80 and 90 are formatted using non-final form letters for example תש״פ for the year 5780. Setting this to true (the default is false) will use the final form letters for מנצפ״ך and will format the year 5780 as תש״ף.
      Parameters:
      useFinalFormLetters - Set this to true to use final form letters when formatting Hebrew years.
    • isUseLongHebrewYears

      public boolean isUseLongHebrewYears()
      Returns whether the class is set to use the thousands digit when formatting. When formatting a Hebrew Year, traditionally the thousands digit is omitted and output for a year such as 5729 (1969 Gregorian) would be calculated for 729 and format as תשכ״ט. When set to true the long format year such as ה׳ תשכ״ט for 5729/1969 is returned.
      Returns:
      true if set to use the thousands digit when formatting Hebrew dates and numbers.
    • setUseLongHebrewYears

      public void setUseLongHebrewYears​(boolean useLongHebrewYears)
      When formatting a Hebrew Year, traditionally the thousands digit is omitted and output for a year such as 5729 (1969 Gregorian) would be calculated for 729 and format as תשכ״ט. This method allows setting this to true to return the long format year such as ה׳ תשכ״ט for 5729/1969.
      Parameters:
      useLongHebrewYears - Set this to true to use the long formatting
    • format

      public String format​(JewishDate jewishDate)
      Formats the Jewish date. If the formatter is set to Hebrew, it will format in the form, "day Month year" for example כ״א שבט תשכ״ט, and the format "21 Shevat, 5729" if not.
      Parameters:
      jewishDate - the JewishDate to be formatted
      Returns:
      the formatted date. If the formatter is set to Hebrew, it will format in the form, "day Month year" for example כ״א שבט תשכ״ט, and the format "21 Shevat, 5729" if not.
    • formatMonth

      public String formatMonth​(JewishDate jewishDate)
      Returns a string of the current Hebrew month such as "Tishrei". Returns a string of the current Hebrew month such as "אדר ב׳".
      Parameters:
      jewishDate - the JewishDate to format
      Returns:
      the formatted month name
      See Also:
      isHebrewFormat(), setHebrewFormat(boolean), getTransliteratedMonthList(), setTransliteratedMonthList(String[])
    • formatOmer

      public String formatOmer​(JewishCalendar jewishCalendar)
      Returns a String of the Omer day in the form ל״ג בעומר if Hebrew Format is set, or "Omer X" or "Lag B'Omer" if not. An empty string if there is no Omer this day.
      Parameters:
      jewishCalendar - the JewishCalendar to be formatted
      Returns:
      a String of the Omer day in the form or an empty string if there is no Omer this day. The default formatting has a ב׳ prefix that would output בעומר, but this can be set via the setHebrewOmerPrefix(String) method to use a ל and output ל״ג לעומר.
      See Also:
      isHebrewFormat(), getHebrewOmerPrefix(), setHebrewOmerPrefix(String)
    • formatMolad

      private static String formatMolad​(long moladChalakim)
      Formats a molad.
      Parameters:
      moladChalakim - the chalakim of the molad
      Returns:
      the formatted molad. FIXME: define proper format in English and Hebrew.
      TODO:
      Experimental and incomplete.
    • getFormattedKviah

      public String getFormattedKviah​(int jewishYear)
      Returns the kviah in the traditional 3 letter Hebrew format where the first letter represents the day of week of Rosh Hashana, the second letter represents the lengths of Cheshvan and Kislev (Shelaimim , Kesidran or Chaserim) and the 3rd letter represents the day of week of Pesach. For example 5729 (1969) would return בשה (Rosh Hashana on Monday, Shelaimim, and Pesach on Thursday), while 5771 (2011) would return השג (Rosh Hashana on Thursday, Shelaimim, and Pesach on Tuesday).
      Parameters:
      jewishYear - the Jewish year
      Returns:
      the Hebrew String such as בשה for 5729 (1969) and השג for 5771 (2011).
    • formatDafYomiBavli

      public String formatDafYomiBavli​(Daf daf)
      Formats the Daf Yomi Bavli in the format of "עירובין נ״ב" in Hebrew, or the transliterated format of "Eruvin 52".
      Parameters:
      daf - the Daf to be formatted.
      Returns:
      the formatted daf.
    • formatDafYomiYerushalmi

      Formats the Daf Yomi Yerushalmi in the format of "עירובין נ״ב" in Hebrew, or the transliterated format of "Eruvin 52".
      Parameters:
      daf - the Daf to be formatted.
      Returns:
      the formatted daf.
    • formatHebrewNumber

      public String formatHebrewNumber​(int number)
      Returns a Hebrew formatted string of a number. The method can calculate from 0 - 9999.
      • Single digit numbers such as 3, 30 and 100 will be returned with a ׳ (Geresh) appended as at the end. For example ג׳, ל׳ and ק׳
      • multi digit numbers such as 21 and 769 will be returned with a ״ (Gershayim) between the second to last and last letters. For example כ״א, תשכ״ט
      • 15 and 16 will be returned as ט״ו and ט״ז
      • Single digit numbers (years assumed) such as 6000 (%1000=0) will be returned as ו׳ אלפים
      • 0 will return אפס
      Parameters:
      number - the number to be formatted. It will trow an IllegalArgumentException if the number is < 0 or > 9999.
      Returns:
      the Hebrew formatted number such as תשכ״ט
      See Also:
      isUseFinalFormLetters(), isUseGershGershayim(), isHebrewFormat()
    • getTransliteratedParshiosList

      Retruns the list of transliterated parshiyos used by this formatter.
      Returns:
      the list of transliterated Parshios
    • setTransliteratedParshiosList

      public void setTransliteratedParshiosList​(EnumMap<JewishCalendar.Parsha,​String> transliteratedParshaMap)
      Setter method to allow overriding of the default list of parshiyos transliterated into into Latin chars. The default uses Ashkenazi American English transliteration.
      Parameters:
      transliteratedParshaMap - the transliterated Parshios as an EnumMap to set
      See Also:
      getTransliteratedParshiosList()
    • formatParsha

      public String formatParsha​(JewishCalendar jewishCalendar)
      Returns a String with the name of the current parsha(ios). If the formatter is set to format in Hebrew, returns a string of the current parsha(ios) in Hebrew for example בראשית or ניצבים וילך or an empty string if there are none. If not set to Hebrew, it returns a string of the parsha(ios) transliterated into Latin chars. The default uses Ashkenazi pronunciation in typical American English spelling, for example Bereshis or Nitzavim Vayeilech or an empty string if there are none.
      Parameters:
      jewishCalendar - the JewishCalendar Object
      Returns:
      today's parsha(ios) in Hebrew for example, if the formatter is set to format in Hebrew, returns a string of the current parsha(ios) in Hebrew for example בראשית or ניצבים וילך or an empty string if there are none. If not set to Hebrew, it returns a string of the parsha(ios) transliterated into Latin chars. The default uses Ashkenazi pronunciation in typical American English spelling, for example Bereshis or Nitzavim Vayeilech or an empty string if there are none.
    • formatSpecialParsha

      public String formatSpecialParsha​(JewishCalendar jewishCalendar)
      Returns a String with the name of the current special parsha of Shekalim, Zachor, Parah or Hachodesh or an empty String for a non-special parsha. If the formatter is set to format in Hebrew, it returns a string of the current special parsha in Hebrew, for example שקלים, זכור, פרה or החדש. An empty string if the date is not a special parsha. If not set to Hebrew, it returns a string of the special parsha transliterated into Latin chars. The default uses Ashkenazi pronunciation in typical American English spelling Shekalim, Zachor, Parah or Hachodesh.
      Parameters:
      jewishCalendar - the JewishCalendar Object
      Returns:
      today's special parsha. If the formatter is set to format in Hebrew, returns a string of the current special parsha in Hebrew for in the format of שקלים, זכור, פרה or החדש or an empty string if there are none. If not set to Hebrew, it returns a string of the special parsha transliterated into Latin chars. The default uses Ashkenazi pronunciation in typical American English spelling of Shekalim, Zachor, Parah or Hachodesh. An empty string if there are none.