Skip to content

Commit b4b0edf

Browse files
authored
Replace SimpleDateFormat with DateTimeFormatter in HebrewDateFormatter
1 parent 52506a7 commit b4b0edf

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/main/java/com/kosherjava/zmanim/hebrewcalendar/HebrewDateFormatter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package com.kosherjava.zmanim.hebrewcalendar;
1717

18-
import java.text.SimpleDateFormat;
18+
import java.time.format.DateTimeFormatter;
1919
import java.util.EnumMap;
2020

2121
/**
@@ -69,7 +69,7 @@ public class HebrewDateFormatter {
6969
/**
7070
* The internal DateFormat.  See {@link #isLongWeekFormat()} and {@link #setLongWeekFormat(boolean)}.
7171
*/
72-
private SimpleDateFormat weekFormat = null;
72+
private DateTimeFormatter weekFormat = null;
7373

7474
/**
7575
* List of transliterated parshiyos using the default <em>Ashkenazi</em> pronunciation.&nbsp; The formatParsha method
@@ -122,7 +122,7 @@ public class HebrewDateFormatter {
122122
* Default constructor sets the {@link EnumMap}s of Hebrew and default transliterated parshiyos.
123123
*/
124124
public HebrewDateFormatter() {
125-
weekFormat = new SimpleDateFormat("EEEE");
125+
weekFormat = DateTimeFormatter.ofPattern("EEEE");
126126
transliteratedParshaMap = new EnumMap<>(JewishCalendar.Parsha.class);
127127
transliteratedParshaMap.put(JewishCalendar.Parsha.NONE, "");
128128
transliteratedParshaMap.put(JewishCalendar.Parsha.BERESHIS, "Bereshis");
@@ -294,9 +294,9 @@ public boolean isLongWeekFormat() {
294294
public void setLongWeekFormat(boolean longWeekFormat) {
295295
this.longWeekFormat = longWeekFormat;
296296
if (longWeekFormat) {
297-
weekFormat = new SimpleDateFormat("EEEE");
297+
weekFormat = DateTimeFormatter.ofPattern("EEEE");
298298
} else {
299-
weekFormat = new SimpleDateFormat("EEE");
299+
weekFormat = DateTimeFormatter.ofPattern("EEE");
300300
}
301301
}
302302

0 commit comments

Comments
 (0)