Class HebrewDateFormatter
java.lang.Object
com.kosherjava.zmanim.hebrewcalendar.HebrewDateFormatter
The HebrewDateFormatter class formats a
JewishDate
.
The class formats Jewish dates, numbers, Daf Yomi (Bavli and Yerushalmi), the Omer,
Parshas Hashavua (including the special parshiyos of Shekalim, Zachor, Parah
and 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 - 2023
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
The gersh character is the ׳ char that is similar to a single quote and is used in formatting Hebrew numbers.private static final String
The gershyim character is the ״ char that is similar to a double quote and is used in formatting Hebrew numbers.private static final String[]
Unicode list of Hebrew days of week in the format of["ראשון", "שני","שלישי","רביעי", "חמישי","ששי","שבת"]
private boolean
SeeisHebrewFormat()
andsetHebrewFormat(boolean)
.private final String[]
Hebrew holiday array in the following format.["ערב פסח", "פסח", "חול המועד פסח", "פסח שני", "ערב שבועות", "שבועות", "שבעה עשר בתמוז", "תשעה באב", "ט״ו באב", "ערב ראש השנה", "ראש השנה", "צום גדליה", "ערב יום כיפור", "יום כיפור", "ערב סוכות", "סוכות", "חול המועד סוכות", "הושענא רבה", "שמיני עצרת", "שמחת תורה", "ערב חנוכה", "חנוכה", "עשרה בטבת", "ט״ו בשבט", "תענית אסתר", "פורים", "פורים שושן", "פורים קטן", "ראש חודש", "יום השואה", "יום הזיכרון", "יום העצמאות", "יום ירושלים", "ל״ג בעומר", "פורים שושן קטן"]
private static final String[]
Unicode list of Hebrew months in the following format["ניסן","אייר", "סיון","תמוז","אב","אלול", "תשרי","חשון","כסלו","טבת", "שבט","אדר","אדר ב","אדר א"]
private String
The Hebrew omer prefix charachter.private EnumMap<JewishCalendar.Parsha,
String> UnicodeEnumMap
of Hebrew parshiyos. The list includes double and special parshiyos and contains"בראשית, נח, לך לך, וירא, חיי שרה, תולדות, ויצא, וישלח, וישב, מקץ, ויגש, ויחי, שמות, וארא, בא, בשלח, יתרו, משפטים, תרומה, תצוה, כי תשא, ויקהל, פקודי, ויקרא, צו, שמיני, תזריע, מצרע, אחרי מות, קדושים, אמור, בהר, בחקתי, במדבר, נשא, בהעלתך, שלח לך, קרח, חוקת, בלק, פינחס, מטות, מסעי, דברים, ואתחנן, עקב, ראה, שופטים, כי תצא, כי תבוא, נצבים, וילך, האזינו, וזאת הברכה, ויקהל פקודי, תזריע מצרע, אחרי מות קדושים, בהר בחקתי, חוקת בלק, מטות מסעי, נצבים וילך, שקלים, זכור, פרה, החדש, שובה,שירה,הגדול, חזון,נחמו"
private boolean
private String[]
private String[]
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> List of transliterated parshiyos using the default Ashkenazi pronunciation. The formatParsha method uses this for transliterated parsha formatting. This list can be overridden (for Sephardi English transliteration for example) by setting thesetTransliteratedParshiosList(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,Shuva, Shira, Hagadol, Chazon, Nachamu".private String
The default value for formatting Shabbos (Saturday). Defaults to Shabbos.private boolean
private boolean
private boolean
private SimpleDateFormat
The internal DateFormat. SeeisLongWeekFormat()
andsetLongWeekFormat(boolean)
. -
Constructor Summary
ConstructorDescriptionDefault constructor sets theEnumMap
s of Hebrew and default transliterated parshiyos. -
Method Summary
Modifier and TypeMethodDescriptionformat
(JewishDate jewishDate) Formats the Jewish date.formatDafYomiBavli
(Daf daf) Formats the Daf Yomi Yerushalmi in the format of "עירובין נ״ב" inHebrew
, or the transliterated format of "Eruvin 52".formatDayOfWeek
(JewishDate jewishDate) Formats the day of week.formatHebrewNumber
(int number) Returns a Hebrew formatted string of a number.private static String
formatMolad
(long moladChalakim) Formats a molad.formatMonth
(JewishDate jewishDate) Returns a string of the current Hebrew month such as "Tishrei".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.formatParsha
(JewishCalendar jewishCalendar) Returns a String with the name of the current parsha(ios).formatParsha
(JewishCalendar.Parsha parsha) Returns a String with the name of the current parsha(ios).formatRoshChodesh
(JewishCalendar jewishCalendar) Formats a day as Rosh Chodesh in the format of in the format of ראש חודש שבט or Rosh Chodesh Shevat.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.formatYomTov
(JewishCalendar jewishCalendar) Formats the Yom Tov (holiday) in Hebrew or transliterated Latin characters.getFormattedKviah
(int jewishYear) 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 thesetHebrewOmerPrefix(String)
.String[]
Returns the list of holidays transliterated into Latin chars.String[]
Returns the list of months transliterated into Latin chars.Retruns the list of transliterated parshiyos used by this formatter.Returns the day of Shabbos transliterated into Latin chars.boolean
Returns if the formatter is set to use Hebrew formatting in the various formatting methods.boolean
Returns if theformatDayOfWeek(JewishDate)
will use the long format such as ראשון or short such as א when formatting the day of week inHebrew
.boolean
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
Returns whether the class is set to use the Geresh ׳ and Gershayim ״ in formatting Hebrew dates and numbers.boolean
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 theformatDayOfWeek(JewishDate)
will use the long format such as ראשון or short such as א when formatting the day of week inHebrew
.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 theformatDayOfWeek(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 תשכ״ט.
-
Field Details
-
hebrewFormat
SeeisHebrewFormat()
andsetHebrewFormat(boolean)
. -
useLonghebrewYears
-
useGershGershayim
-
longWeekFormat
-
useFinalFormLetters
-
weekFormat
The internal DateFormat. SeeisLongWeekFormat()
andsetLongWeekFormat(boolean)
. -
transliteratedParshaMap
List of transliterated parshiyos using the default Ashkenazi pronunciation. The formatParsha method uses this for transliterated parsha formatting. This list can be overridden (for Sephardi English transliteration for example) by setting thesetTransliteratedParshiosList(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,Shuva, Shira, Hagadol, Chazon, Nachamu".- See Also:
-
hebrewParshaMap
UnicodeEnumMap
of Hebrew parshiyos. The list includes double and special parshiyos and contains"בראשית, נח, לך לך, וירא, חיי שרה, תולדות, ויצא, וישלח, וישב, מקץ, ויגש, ויחי, שמות, וארא, בא, בשלח, יתרו, משפטים, תרומה, תצוה, כי תשא, ויקהל, פקודי, ויקרא, צו, שמיני, תזריע, מצרע, אחרי מות, קדושים, אמור, בהר, בחקתי, במדבר, נשא, בהעלתך, שלח לך, קרח, חוקת, בלק, פינחס, מטות, מסעי, דברים, ואתחנן, עקב, ראה, שופטים, כי תצא, כי תבוא, נצבים, וילך, האזינו, וזאת הברכה, ויקהל פקודי, תזריע מצרע, אחרי מות קדושים, בהר בחקתי, חוקת בלק, מטות מסעי, נצבים וילך, שקלים, זכור, פרה, החדש, שובה,שירה,הגדול, חזון,נחמו"
-
GERESH
The gersh character is the ׳ char that is similar to a single quote and is used in formatting Hebrew numbers.- See Also:
-
GERSHAYIM
The gershyim character is the ״ char that is similar to a double quote and is used in formatting Hebrew numbers.- See Also:
-
transliteratedMonths
Transliterated month names. Defaults to ["Nissan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Cheshvan", "Kislev", "Teves", "Shevat", "Adar", "Adar II", "Adar I" ]. -
hebrewOmerPrefix
The Hebrew omer prefix charachter. It defaults to ב producing בעומר, but can be set to ל to produce לעומר (or any other prefix). -
transliteratedShabbosDayOfweek
The default value for formatting Shabbos (Saturday). Defaults to Shabbos. -
transliteratedHolidays
-
hebrewHolidays
Hebrew holiday array in the following format.["ערב פסח", "פסח", "חול המועד פסח", "פסח שני", "ערב שבועות", "שבועות", "שבעה עשר בתמוז", "תשעה באב", "ט״ו באב", "ערב ראש השנה", "ראש השנה", "צום גדליה", "ערב יום כיפור", "יום כיפור", "ערב סוכות", "סוכות", "חול המועד סוכות", "הושענא רבה", "שמיני עצרת", "שמחת תורה", "ערב חנוכה", "חנוכה", "עשרה בטבת", "ט״ו בשבט", "תענית אסתר", "פורים", "פורים שושן", "פורים קטן", "ראש חודש", "יום השואה", "יום הזיכרון", "יום העצמאות", "יום ירושלים", "ל״ג בעומר", "פורים שושן קטן"]
-
hebrewMonths
Unicode list of Hebrew months in the following format["ניסן","אייר", "סיון","תמוז","אב","אלול", "תשרי","חשון","כסלו","טבת", "שבט","אדר","אדר ב","אדר א"]
- See Also:
-
hebrewDaysOfWeek
Unicode list of Hebrew days of week in the format of["ראשון", "שני","שלישי","רביעי", "חמישי","ששי","שבת"]
-
-
Constructor Details
-
HebrewDateFormatter
public HebrewDateFormatter()Default constructor sets theEnumMap
s of Hebrew and default transliterated parshiyos.
-
-
Method Details
-
isLongWeekFormat
Returns if theformatDayOfWeek(JewishDate)
will use the long format such as ראשון or short such as א when formatting the day of week inHebrew
.- Returns:
- the longWeekFormat
- See Also:
-
setLongWeekFormat
Setting to control if theformatDayOfWeek(JewishDate)
will use the long format such as ראשון or short such as א when formatting the day of week inHebrew
.- 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 thesetTransliteratedShabbosDayOfWeek(String)
- Returns:
- the transliteratedShabbos. The default list of months uses Ashkenazi pronunciation "Shabbos".
- See Also:
-
setTransliteratedShabbosDayOfWeek
Setter to override the default transliterated name of "Shabbos" to alternate spelling such as "Shabbat" used by theformatDayOfWeek(JewishDate)
- Parameters:
transliteratedShabbos
- the transliteratedShabbos to set- See Also:
-
getTransliteratedHolidayList
Returns the list of holidays transliterated into Latin chars. This is used by theformatYomTov(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","Isru Chag"].
- See Also:
-
setTransliteratedHolidayList
Sets the list of holidays transliterated into Latin chars. This is used by theformatYomTov(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
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:
-
formatRoshChodesh
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 emptyString
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 emptyString
will be returned.
-
isHebrewFormat
Returns if the formatter is set to use Hebrew formatting in the various formatting methods.- Returns:
- the hebrewFormat
- See Also:
-
setHebrewFormat
Sets the formatter to format in Hebrew in the various formatting methods.- Parameters:
hebrewFormat
- the hebrewFormat to set- See Also:
-
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 thesetHebrewOmerPrefix(String)
.- Returns:
- the hebrewOmerPrefix
- See Also:
-
setHebrewOmerPrefix
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:
-
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
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:
-
formatDayOfWeek
Formats the day of week. IfHebrew 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:
-
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
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
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
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
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
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
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
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:
-
formatOmer
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:
-
formatMolad
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
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
orChaserim
) 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
Formats the Daf Yomi Bavli in the format of "עירובין נ״ב" inHebrew
, 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 "עירובין נ״ב" inHebrew
, or the transliterated format of "Eruvin 52".- Parameters:
daf
- the Daf to be formatted.- Returns:
- the formatted daf.
-
formatHebrewNumber
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:
-
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:
-
formatParsha
Returns a String with the name of the current parsha(ios). This method gets the current parsha by callingJewishCalendar.getParshah()
that does not return a parsha for any non-Shabbos or a Shabbos that occurs on a Yom Tov, and will return an emptyString
in those cases. If the classis set to format in Hebrew
it will return aString
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.
- See Also:
-
formatParsha
Returns a String with the name of the current parsha(ios). This method overloadsformatParsha(JewishCalendar)
and unlike that method, it will format the parsha passed to this method regardless of the day of week. This is the way to format a parsha retrieved from callingJewishCalendar.getUpcomingParshah()
.- Parameters:
parsha
- a JewishCalendar.Parsha 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.
- See Also:
-
formatSpecialParsha
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.
-