resolution in consolidated mode: use <= for time intervals
authorgregor herrmann <gregor@toastfreeware.priv.at>
Sun, 5 Aug 2018 17:10:50 +0000 (19:10 +0200)
committergregor herrmann <gregor@toastfreeware.priv.at>
Sun, 5 Aug 2018 17:10:50 +0000 (19:10 +0200)
web/seepark_web.py

index bb59732..523e52d 100644 (file)
@@ -85,11 +85,11 @@ def select_sensordata(sensor_id, sensor_type, begin, end, mode):
         )
         duration = (end - begin).total_seconds()
         day = 60 * 60 * 24
-        if duration < day:
+        if duration <= day:
             resolution = resolutions['day']
-        elif duration < 7 * day:
+        elif duration <= 7 * day:
             resolution = resolutions['week']
-        elif duration < 31 * day:
+        elif duration <= 31 * day:
             resolution = resolutions['month']
         else:
             resolution = resolutions['year']