You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by jd...@apache.org on 2020/04/22 11:17:38 UTC

[isis] branch INCSUP-538 created (now 091dbfd)

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

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


      at 091dbfd  INCSUP-538: possible place to adapt Joda LocalDateTime display ...?

This branch includes the following new commits:

     new 091dbfd  INCSUP-538: possible place to adapt Joda LocalDateTime display ...?

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[isis] 01/01: INCSUP-538: possible place to adapt Joda LocalDateTime display ...?

Posted by jd...@apache.org.
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 <jo...@yodo.nl>
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);
     }