Skip to content

Commit 8283310

Browse files
authored
Rename getXSDDateTime to formatXSDDateTime
- Remove unnecessary and broken IF statement in ZmanimFormatter
1 parent 5a3b3d9 commit 8283310

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -277,27 +277,21 @@ public String format(Time time) {
277277
* the {@link java.time.ZoneId ZoneId} used to help format based on the <code>Instant</code>'s DST and other
278278
* settings.
279279
* @return the formatted String
280+
* @see #getXSDateTime(Instant)
280281
*/
281282
public String formatDateTime(Instant instant, ZoneId zoneId) {
282283
ZonedDateTime dateTime = instant.atZone(zoneId);
283-
284-
if (this.dateTimeFormatter.toString().equals("yyyy-MM-dd'T'HH:mm:ss")) { // FIXME this works in the SimpleDateFormat but not with a DateTimeFormatter
285-
return getXSDateTime(instant);
286-
} else {
287-
return this.dateTimeFormatter.format(dateTime);
288-
}
284+
return this.getDateTimeFormatter().format(dateTime);
289285
}
290286

291287
/**
292288
* Format the <code>Instant</code> using the format "yyyy-MM-dd'T'HH:mm:ssXXX".
293289
* @param instant the <code>Instant</code> to format.
294290
* @return the <code>Instant</code> formatted using the format "yyyy-MM-dd'T'HH:mm:ssXXX
295291
*/
296-
public String getXSDateTime(Instant instant) {
297-
DateTimeFormatter formatter =
298-
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
299-
.withZone(getZoneId());
300-
292+
public String formatXSDateTime(Instant instant) {
293+
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
294+
.withZone(getZoneId());
301295
return formatter.format(instant);
302296
}
303297

0 commit comments

Comments
 (0)