This is an automated email from the ASF dual-hosted git repository.

jdoornenbal pushed a commit to branch INCSUP-538
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 091dbfd36abf7210b33398e6db28281cf499694d
Author: Johan Doornenbal <[email protected]>
AuthorDate: Wed Apr 22 13:17:07 2020 +0200

    INCSUP-538: possible place to adapt Joda LocalDateTime display ...?
---
 .../components/scalars/jodatime/DateConverterForJodaAbstract.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/DateConverterForJodaAbstract.java
 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/DateConverterForJodaAbstract.java
index 5129e77..d1a647f 100644
--- 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/DateConverterForJodaAbstract.java
+++ 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/DateConverterForJodaAbstract.java
@@ -20,6 +20,7 @@ package 
org.apache.isis.viewer.wicket.ui.components.scalars.jodatime;
 
 import org.apache.wicket.util.convert.ConversionException;
 import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
 import org.joda.time.LocalDate;
 import org.joda.time.LocalDateTime;
 import org.joda.time.format.DateTimeFormat;
@@ -28,6 +29,7 @@ import org.joda.time.format.DateTimeFormatter;
 import 
org.apache.isis.viewer.wicket.ui.components.scalars.DateConverterAbstract;
 
 import java.util.Locale;
+import java.util.TimeZone;
 
 abstract class DateConverterForJodaAbstract<T> extends 
DateConverterAbstract<T> {
     
@@ -47,7 +49,9 @@ abstract class DateConverterForJodaAbstract<T> extends 
DateConverterAbstract<T>
     protected String doConvertToString(T value, Locale locale) {
         // for JodaLocalDate, the date time pattern is same as date pattern, 
so can use either to convert to string.
         T t = plusDays(value, adjustBy);
-        return toString(t, getFormatterForDateTimePattern());
+        final DateTimeFormatter formatterForDateTimePattern = 
getFormatterForDateTimePattern().withZone(DateTimeZone.forTimeZone(
+                TimeZone.getTimeZone("Europe/Amsterdam"))); // INCSUP-538: 
setting this hard would probably be a hack. Is there a means to get this from 
the browser?
+        return toString(t, formatterForDateTimePattern);
     }
 
 

Reply via email to