Skip to content

Commit 370ec4e

Browse files
authored
ZmanimFormatter - properly set prepend 00 if needed
1 parent 91fda90 commit 370ec4e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎src/main/java/com/kosherjava/zmanim/util/ZmanimFormatter.java‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void setZoneId(ZoneId zoneId) {
106106
public static final int SEXAGESIMAL_XSD_FORMAT = 0;
107107

108108
/**
109-
* Defaults to {@link #SEXAGESIMAL_SECONDS_FORMAT}.
109+
* Set by the constructor to {@link #SEXAGESIMAL_SECONDS_FORMAT}.
110110
* @see #setTimeFormat(int)
111111
*/
112112
private int timeFormat;
@@ -218,9 +218,10 @@ public DateTimeFormatter getDateTimeFormatter() {
218218
* @param useMillis should milliseconds be used in formatting time.
219219
*/
220220
private void setSettings(boolean prependZeroHours, boolean useSeconds, boolean useMillis) {
221-
this.prependZeroHours = prependZeroHours;
222-
this.useSeconds = useSeconds;
223-
this.useMillis = useMillis;
221+
this.prependZeroHours = prependZeroHours;
222+
this.useSeconds = useSeconds;
223+
this.useMillis = useMillis;
224+
this.hourNF = new DecimalFormat(prependZeroHours ? "00" : "0");
224225
}
225226

226227
/**

0 commit comments

Comments
 (0)