Skip to content

Commit

Permalink
fix the instant conversion issue
Browse files Browse the repository at this point in the history
Parse the String by Instant parse instead of Spring parser which uses a different ISO format.
  • Loading branch information
kingsleylong authored and orende committed Apr 2, 2024
1 parent 602e876 commit 56517dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ public Instant getFromDate() {
return fromDate;
}

public void setFromDate(Instant fromDate) {
this.fromDate = fromDate;
public void setFromDate(String fromDate) {
this.fromDate = Instant.parse(fromDate);
}

public Instant getToDate() {
return toDate;
}

public void setToDate(Instant toDate) {
this.toDate = toDate;
public void setToDate(String toDate) {
this.toDate = Instant.parse(toDate);
}
}
}
4 changes: 2 additions & 2 deletions src/main/resources/templates/admin/selectItinerary.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
<input type="hidden" th:name="|legs[${legStatus.index}].toUnLocode|" th:value="${leg.to}"/>

<input type="hidden" th:name="|legs[${legStatus.index}].fromDate|"
th:value="${#dates.format(leg.loadTime,'yyyy-MM-dd hh:mm')}"/>
th:value="${leg.loadTime}"/>
<input type="hidden" th:name="|legs[${legStatus.index}].toDate|"
th:value="${#dates.format(leg.unloadTime,'yyyy-MM-dd hh:mm')}"/>
th:value="${leg.unloadTime}"/>
<tr>
<td th:text="${leg.voyageNumber}"></td>
<td th:text="${leg.from}"></td>
Expand Down

0 comments on commit 56517dc

Please sign in to comment.