[Lada-commits] [PATCH 2 of 5] Adjust end to end of the day

Wald Commits scm-commit at wald.intevation.org
Fri Sep 30 18:42:31 CEST 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1475249884 -7200
# Node ID 90bc64e74e4ae9024b810995ddd332fe644bd1e4
# Parent  43599f66ceafe4a9bbd990dcd76a23fc05b3c3fe
Adjust end to end of the day.

Before, no Probe could be generated at the day of the end.

diff -r 43599f66ceaf -r 90bc64e74e4a src/main/java/de/intevation/lada/factory/ProbeFactory.java
--- a/src/main/java/de/intevation/lada/factory/ProbeFactory.java	Fri Sep 30 16:37:20 2016 +0200
+++ b/src/main/java/de/intevation/lada/factory/ProbeFactory.java	Fri Sep 30 17:38:04 2016 +0200
@@ -201,8 +201,14 @@
     public List<LProbe> create(Messprogramm messprogramm, Long from, Long to) {
         Calendar start = Calendar.getInstance();
         start.setTimeInMillis(from);
+
         Calendar end = Calendar.getInstance();
         end.setTimeInMillis(to);
+        /* Adjust to end of the day as we want to generate Probe objects
+         * before or at this day. */
+        end.set(Calendar.HOUR_OF_DAY, 23);
+        end.set(Calendar.MINUTE, 59);
+        end.set(Calendar.SECOND, 59);
 
         List<LProbe> proben = new ArrayList<LProbe>();
 


More information about the Lada-commits mailing list