changeset 7942:1d6e5d9d9e57

Fixed date range input panels.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 18 Jun 2014 14:26:36 +0200
parents 48d8dba891f6
children bef9937a2dd9
files gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MultiPeriodPanel.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/PeriodPanel.java
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;
                 }
--- 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;

http://dive4elements.wald.intevation.org