Skip to content

Commit 0cd15b2

Browse files
authored
Merge pull request #30 from refractions-research/exportdatefix
date format export fix
2 parents 35d8b1a + 6990414 commit 0cd15b2

File tree

1 file changed

+9
-1
lines changed
  • jeometry-common/src/main/java/org/jeometry/common/date

1 file changed

+9
-1
lines changed

jeometry-common/src/main/java/org/jeometry/common/date/Dates.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ static String format(final DateFormat format, final Date date) {
6464
return format.format(date);
6565
}
6666

67+
static String format(final DateTimeFormatter formatter, final LocalDate date) {
68+
if (date == null) {
69+
return null;
70+
} else {
71+
return formatter.format(date);
72+
}
73+
}
74+
6775
static String format(final int dateStyle, final int timeStyle, final Timestamp timestamp) {
6876
final DateFormat format = DateFormat.getDateTimeInstance(dateStyle, timeStyle);
6977
return format(format, timestamp);
@@ -451,7 +459,7 @@ static Timestamp getTimestamp(final String dateString) {
451459
if (dateString != null) {
452460
final Instant instant = Instant.parse(dateString);
453461
return Timestamp.from(instant);
454-
} else {
462+
} else {
455463
return null;
456464
}
457465
}

0 commit comments

Comments
 (0)