diff --git a/timeseriesviewer/timeseries.py b/timeseriesviewer/timeseries.py
index 3a96be0dfd178d0c8e461f1745601415513dd123..2fc30be0b5dec859c7359df0dd40dc7ce6021a2a 100644
--- a/timeseriesviewer/timeseries.py
+++ b/timeseriesviewer/timeseries.py
@@ -298,6 +298,8 @@ class TimeSeriesDatum(QObject):
     def __lt__(self, other):
         if self.date < other.date:
             return True
+        elif self.date > other.date:
+            return False
         else:
             return self.sensor.id() < other.sensor.id()