changeset 8639:97d60b0afe24

(issue1755) Fix check for valid date range.
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 27 Mar 2015 17:26:34 +0100
parents 3c78fc83fc6d
children 0d15ebafbd0e
files artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityPeriodsSelect.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityPeriodsSelect.java	Fri Mar 27 17:25:30 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityPeriodsSelect.java	Fri Mar 27 17:26:34 2015 +0100
@@ -134,9 +134,9 @@
         long max = minMax[1];
         for (DateRange range: access.getDateRanges()) {
             long a = range.getFrom().getTime();
-            long b = range.getFrom().getTime();
-            if ((a < min || a > max) &&
-                ( b < min || b > max)) {
+            long b = range.getTo().getTime();
+            log.debug("min max a b " + min + " " + max + " " + a + " " + b);
+            if (b < min || a > max || a > b) {
                 DateFormat df = Formatter.getDateFormatter(context.getMeta(), "dd.MM.yyyy");
                 throw new IllegalArgumentException(Resources.getMsg(context.getMeta(),
                              I18N_NO_DATA_FOR_PERIOD,

http://dive4elements.wald.intevation.org