[PATCH 4 of 7] Fixed date range input panels

Wald Commits scm-commit at wald.intevation.org
Wed Jun 18 14:29:19 CEST 2014


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1403094396 -7200
# Node ID 1d6e5d9d9e5718a769e703fa3af62bd8e9e7c813
# Parent  48d8dba891f6d1ce886754616963853061017a03
Fixed date range input panels.

diff -r 48d8dba891f6 -r 1d6e5d9d9e57 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MultiPeriodPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MultiPeriodPanel.java	Wed Jun 18 14:25:46 2014 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MultiPeriodPanel.java	Wed Jun 18 14:26:36 2014 +0200
@@ -11,6 +11,7 @@
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.i18n.client.DateTimeFormat;
 
+import com.smartgwt.client.data.DateRange;
 import com.smartgwt.client.types.ListGridFieldType;
 import com.smartgwt.client.widgets.Button;
 import com.smartgwt.client.widgets.Canvas;
@@ -70,8 +71,9 @@
         add.addClickHandler(new ClickHandler() {
             @Override
             public void onClick(ClickEvent ce) {
-                Date f = inputPanel.getFromDate();
-                Date t = inputPanel.getToDate();
+                DateRange range = inputPanel.getValue();
+                Date f = range.getStartDate();
+                Date t = range.getEndDate();
                 if (f == null || t == null) {
                     return;
                 }
diff -r 48d8dba891f6 -r 1d6e5d9d9e57 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/PeriodPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/PeriodPanel.java	Wed Jun 18 14:25:46 2014 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/PeriodPanel.java	Wed Jun 18 14:26:36 2014 +0200
@@ -11,6 +11,7 @@
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.i18n.client.DateTimeFormat;
 
+import com.smartgwt.client.data.DateRange;
 import com.smartgwt.client.util.SC;
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.Label;
@@ -182,8 +183,9 @@
 
 
     protected boolean saveDateValues() {
-        Date st = inputPanel.getFromDate();
-        Date en = inputPanel.getToDate();
+        DateRange range = inputPanel.getValue();
+        Date st = range.getStartDate();
+        Date en = range.getEndDate();
         if (st == null || en == null) {
             SC.warn(MSG.error_wrong_date());
             return false;


More information about the Dive4Elements-commits mailing list