1
1
/*
2
2
* Zmanim Java API
3
- * Copyright (C) 2011 - 2023 Eliyahu Hershfeld
3
+ * Copyright (C) 2011 - 2024 Eliyahu Hershfeld
4
4
*
5
5
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
6
6
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
20
20
21
21
/**
22
22
* The HebrewDateFormatter class formats a {@link JewishDate}.
23
- * <p>
23
+ *
24
24
* The class formats Jewish dates, numbers, <em>Daf Yomi</em> (<em>Bavli</em> and <em>Yerushalmi</em>), the <em>Omer</em>,
25
25
* <em>Parshas Hashavua</em> (including the special <em>parshiyos</em> of <em>Shekalim</em>, <em>Zachor</em>, <em>Parah</em>
26
26
* and <em>Hachodesh</em>), Yomim Tovim and the Molad (experimental) in Hebrew or Latin chars, and has various settings.
37
37
* @see JewishDate
38
38
* @see JewishCalendar
39
39
*
40
- * @author © Eliyahu Hershfeld 2011 - 2023
40
+ * @author © Eliyahu Hershfeld 2011 - 2024
41
41
*/
42
42
public class HebrewDateFormatter {
43
43
@@ -122,6 +122,7 @@ public class HebrewDateFormatter {
122
122
* Default constructor sets the {@link EnumMap}s of Hebrew and default transliterated parshiyos.
123
123
*/
124
124
public HebrewDateFormatter () {
125
+ weekFormat = new SimpleDateFormat ("EEEE" );
125
126
transliteratedParshaMap = new EnumMap <>(JewishCalendar .Parsha .class );
126
127
transliteratedParshaMap .put (JewishCalendar .Parsha .NONE , "" );
127
128
transliteratedParshaMap .put (JewishCalendar .Parsha .BERESHIS , "Bereshis" );
@@ -373,7 +374,7 @@ public void setTransliteratedShabbosDayOfWeek(String transliteratedShabbos) {
373
374
"Isru Chag" };
374
375
375
376
/**
376
- * Returns the list of holidays transliterated into Latin chars. This is used by the
377
+ * Returns the array of holidays transliterated into Latin chars. This is used by the
377
378
* {@link #formatYomTov(JewishCalendar)} when formatting the Yom Tov String. The default list of months uses
378
379
* Ashkenazi pronunciation in typical American English spelling.
379
380
*
@@ -394,7 +395,7 @@ public String[] getTransliteratedHolidayList() {
394
395
}
395
396
396
397
/**
397
- * Sets the list of holidays transliterated into Latin chars. This is used by the
398
+ * Sets the array of holidays transliterated into Latin chars. This is used by the
398
399
* {@link #formatYomTov(JewishCalendar)} when formatting the Yom Tov String.
399
400
*
400
401
* @param transliteratedHolidays
@@ -575,7 +576,7 @@ public void setHebrewOmerPrefix(String hebrewOmerPrefix) {
575
576
}
576
577
577
578
/**
578
- * Returns the list of months transliterated into Latin chars. The default list of months uses Ashkenazi
579
+ * Returns the array of months transliterated into Latin chars. The default list of months uses Ashkenazi
579
580
* pronunciation in typical American English spelling. This list has a length of 14 with 3 variations for Adar -
580
581
* "Adar", "Adar II", "Adar I"
581
582
*
@@ -688,7 +689,7 @@ public void setUseGershGershayim(boolean useGershGershayim) {
688
689
/**
689
690
* Returns whether the class is set to use the מנצפ״ך letters when
690
691
* formatting years ending in 20, 40, 50, 80 and 90 to produce תש״פ if false or
691
- * תש״ף if true. Traditionally non-final form letters are used, so the year
692
+ * תש״ף if true. Traditionally non-final form letters are used, so the year
692
693
* 5780 would be formatted as תש״פ if the default false is used here. If this returns
693
694
* true, the format תש״ף would be used.
694
695
*
@@ -867,7 +868,7 @@ public String getFormattedKviah(int jewishYear) {
867
868
returnValue = returnValue .replaceAll (GERESH , "" );// geresh is never used in the kviah format
868
869
// boolean isLeapYear = JewishDate.isJewishLeapYear(jewishYear);
869
870
// for efficiency we can avoid the expensive recalculation of the pesach day of week by adding 1 day to Rosh
870
- // Hashana for a 353-day year, 2 for a 354-day year, 3 for a 355 or 383 day year, 4 for a 384-day year and 5 for
871
+ // Hashana for a 353-day year, 2 for a 354-day year, 3 for a 355 or 383- day year, 4 for a 384-day year and 5 for
871
872
// a 385-day year
872
873
return returnValue ;
873
874
}
@@ -1075,7 +1076,7 @@ public String formatParsha(JewishCalendar jewishCalendar) {
1075
1076
* chars. The default uses Ashkenazi pronunciation in typical American English spelling, for example
1076
1077
* Bereshis or Nitzavim Vayeilech or an empty string if there are none.
1077
1078
* @see #formatParsha(JewishCalendar)
1078
- *
1079
+ * @see JewishCalendar#getUpcomingParshah()
1079
1080
*/
1080
1081
public String formatParsha (JewishCalendar .Parsha parsha ) {
1081
1082
return hebrewFormat ? hebrewParshaMap .get (parsha ) : transliteratedParshaMap .get (parsha );
0 commit comments