[PATCH] Fixed date filter for fix overview

Wald Commits scm-commit at wald.intevation.org
Thu Oct 9 14:35:25 CEST 2014


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1412849636 -7200
# Node ID 319aa972a1a312040d88a3955c75729d5bc59f35
# Parent  c668520cc5fb124d177a4a368c8364b373190874
Fixed date filter for fix overview.

diff -r c668520cc5fb -r 319aa972a1a3 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixationPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixationPanel.java	Thu Oct 09 12:20:48 2014 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixationPanel.java	Thu Oct 09 12:13:56 2014 +0200
@@ -427,7 +427,7 @@
     protected static JSONObject createFilter(FixFilter filter, JSONObject root) {
         double fromKm = filter.getFromKm();
         double toKm   = filter.getToKm();
-        boolean hasDate = filter.getFromDate() > 0 && filter.getToDate() > 0;
+        boolean hasDate = filter.hasDate();
 
         if (fromKm >= 0 && toKm >= 0 && fromKm <= toKm) {
             JSONObject range = new JSONObject();
diff -r c668520cc5fb -r 319aa972a1a3 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/FixFilter.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/FixFilter.java	Thu Oct 09 12:20:48 2014 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/FixFilter.java	Thu Oct 09 12:13:56 2014 +0200
@@ -31,8 +31,8 @@
         this.currentKm = -1;
         this.fromClass = -1;
         this.toClass = -1;
-        this.fromDate = -1;
-        this.toDate = -1;
+        this.fromDate = Long.MIN_VALUE;
+        this.toDate = Long.MIN_VALUE;
         this.hasDate = false;
         this.events = new int[0];
     }
@@ -110,5 +110,9 @@
     public int[] getEvents() {
         return this.events;
     }
+
+    public boolean hasDate() {
+        return fromDate != Long.MIN_VALUE && toDate != Long.MIN_VALUE;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4Elements-commits mailing list