HebrewDateFormatter class

The HebrewDateFormatter class formats a {@link JewishDate}.

The class formats Jewish dates in Hebrew or Latin chars, and has various settings. Sample full date output includes (using various options):

  • 21 Shevat, 5729
  • כא שבט תשכט
  • כ״א שבט ה׳תשכ״ט
  • כ״א שבט תש״פ or כ״א שבט תש״ף
  • כ׳ שבט ו׳ אלפים

@see net.sourceforge.zmanim.hebrewcalendar.JewishDate @see net.sourceforge.zmanim.hebrewcalendar.JewishCalendar

@author © Eliyahu Hershfeld 2011 - 2020

Constructors

HebrewDateFormatter()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

format(JewishDate jewishDate) String
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. [...]
formatDafYomiBavli(Daf daf) String
formatDafYomiYerushalmi(Daf daf) String
formatDayOfWeek(JewishDate jewishDate) String
Formats the day of week. If {@link #isHebrewFormat() 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. [...]
formatHebrewNumber(int number) String
Returns a Hebrew formatted string of a number. The method can calculate from 0 - 9999. [...]
formatMolad(double moladChalakim) String
formatMonth(JewishDate jewishDate) String
Returns a string of the current Hebrew month such as "Tishrei". Returns a string of the current Hebrew month such as "אדר ב׳". [...]
formatOmer(JewishCalendar jewishCalendar) String
Returns a String of the Omer day in the form ל״ג בעומר if Hebrew Format is set, or "Omer X" or "Lag BaOmer" if not. An empty string if there is no Omer this day. [...]
formatParsha(JewishCalendar jewishCalendar) String
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. [...]
formatRoshChodesh(JewishCalendar jewishCalendar) String
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. @param jewishCalendar the JewishCalendar @return The formatted String in the format of ראש חודש שבט or Rosh Chodesh Shevat. If it is not Rosh Chodesh, an empty String will be returned.
formatSpecialParsha(JewishCalendar jewishCalendar) String
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. [...]
formatWeeklyParsha(JewishCalendar jewishCalendar) String
formatYomTov(JewishCalendar jewishCalendar) String
Formats the Yom Tov (holiday) in Hebrew or transliterated Latin characters. [...]
getFormattedKviah(int jewishYear) String
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 ({@link JewishDate#SHELAIMIM Shelaimim} , {@link JewishDate#KESIDRAN Kesidran} or {@link JewishDate#CHASERIM 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). [...]
getHebrewOmerPrefix() String
Returns the Hebrew Omer prefix. By default it is the letter ב, but can be set to ל (or any other prefix) using the {@link #setHebrewOmerPrefix(String)}. [...]
getLongOmer(JewishCalendar jewishCalendar) String
getTransliteratedHolidayList() List<String>
Returns the list of holidays transliterated into Latin chars. This is used by the {@link #formatYomTov(JewishCalendar)} when formatting the Yom Tov String. The default list of months uses Ashkenazi pronunciation in typical American English spelling. [...]
getTransliteratedMonthList() List<String>
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" [...]
getTransliteratedParshiosList() Map<Parsha, String>
Retruns the list of transliterated parshiyos used by this formatter. [...]
getTransliteratedShabbosDayOfWeek() String
Returns the day of Shabbos transliterated into Latin chars. The default uses Ashkenazi pronunciation "Shabbos". This can be overwritten using the {@link #setTransliteratedShabbosDayOfWeek(String)} [...]
isHebrewFormat() bool
Returns if the formatter is set to use Hebrew formatting in the various formatting methods. [...]
isLongWeekFormat() bool
Returns if the {@link #formatDayOfWeek(JewishDate)} will use the long format such as ראשון or short such as א when formatting the day of week in {@link #isHebrewFormat() Hebrew}. [...]
isUseFinalFormLetters() bool
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. [...]
isUseGershGershayim() bool
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 כא שבט תשכ. [...]
isUseLongHebrewYears() bool
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. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
setHebrewFormat(bool hebrewFormat) → void
Sets the formatter to format in Hebrew in the various formatting methods. [...]
setHebrewOmerPrefix(String hebrewOmerPrefix) → void
Method to set the Hebrew Omer prefix. By default it is the letter ב, but this allows setting it to a ל (or any other prefix). [...]
setLongWeekFormat(bool longWeekFormat) → void
Setting to control if the {@link #formatDayOfWeek(JewishDate)} will use the long format such as ראשון or short such as א when formatting the day of week in {@link #isHebrewFormat() Hebrew}. [...]
setTransliteratedHolidayList(List<String> transliteratedHolidays) → void
Sets the list of holidays transliterated into Latin chars. This is used by the {@link #formatYomTov(JewishCalendar)} when formatting the Yom Tov String. [...]
setTransliteratedMonthList(List<String> transliteratedMonths) → void
Setter method to allow overriding of the default list of months transliterated into into Latin chars. The default uses Ashkenazi American English transliteration. [...]
setTransliteratedParshiosList(Map<Parsha, String> transliteratedParshaMap) → void
Setter method to allow overriding of the default list of parshiyos transliterated into into Latin chars. The default uses Ashkenazi American English transliteration. [...]
setTransliteratedShabbosDayOfWeek(String transliteratedShabbos) → void
Setter to override the default transliterated name of "Shabbos" to alternate spelling such as "Shabbat" used by the {@link #formatDayOfWeek(JewishDate)} [...]
setUseFinalFormLetters(bool useFinalFormLetters) → void
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 תש״ף. [...]
setUseGershGershayim(bool useGershGershayim) → void
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. [...]
setUseLongHebrewYears(bool useLongHebrewYears) → void
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. [...]
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited