Closed wsargent closed 3 months ago
Hi @wsargent ! I had a look at the PR but would like to see a test verifying the fix.
Okay I will add thatOn May 11, 2023, at 5:28 AM, orende @.***> wrote: Hi @wsargent ! I had a look at the PR but would like to see a test verifying the fix.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
public class InstDateEditor extends PropertyEditorSupport {
@Override
public void setAsText(@Nullable String text) throws IllegalArgumentException {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
LocalDateTime dateTime = LocalDateTime.parse(text, formatter);
setValue(dateTime.toInstant(ZoneOffset.UTC));
}
/**
* Format the Date as String, using the specified DateFormat.
*/
@Override
public String getAsText() {
Instant value = (Instant) getValue();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
String formattedDateTime = formatter.format(value.atZone(ZoneOffset.UTC));
return (value != null ? formattedDateTime : "");
}
I can get the application to error when booking cargo:
See page with exception:
The logs show:
Running on Ubuntu 18, JDK 11