[Dive4elements-commits] [PATCH] Switch start- and stoptime if starttime is after stoptime in timeinterval

Wald Commits scm-commit at wald.intevation.org
Fri Apr 19 16:21:55 CEST 2013


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1366378837 -7200
# Node ID 300c0270c5763a7cd8d564090d9488ecc04c0107
# Parent  496c8c9d49135c8ec319ed6c3b68cb523555e1a4
Switch start- and stoptime if starttime is after stoptime in timeinterval
importer.

diff -r 496c8c9d4913 -r 300c0270c576 flys-backend/src/main/java/de/intevation/flys/importer/ImportTimeInterval.java
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportTimeInterval.java	Fri Apr 19 12:44:55 2013 +0200
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportTimeInterval.java	Fri Apr 19 15:40:37 2013 +0200
@@ -27,8 +27,14 @@
     }
 
     public ImportTimeInterval(Date startTime, Date stopTime) {
-        this.startTime = startTime;
-        this.stopTime  = stopTime;
+        if (startTime.after(stopTime)) {
+            this.stopTime = startTime;
+            this.startTime = stopTime;
+        }
+        else {
+            this.startTime = startTime;
+            this.stopTime  = stopTime;
+        }
     }
 
     public Date getStartTime() {


More information about the Dive4elements-commits mailing list