From ad7d9ac21b8a91511eae0bde69ebfe7f40a2e98a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com>
Date: Sat, 14 Aug 2021 16:33:29 +0200
Subject: [PATCH] calendar utils: Split events shifted by 2h

---
 calendar_utils/parser.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/calendar_utils/parser.py b/calendar_utils/parser.py
index 0a0454bb..d34623e9 100644
--- a/calendar_utils/parser.py
+++ b/calendar_utils/parser.py
@@ -18,9 +18,9 @@ def parse_ical(source):
 
 def split_events(events):
     """Splits events and returns list of past events and future events."""
-    now = arrow.utcnow()
-    past = [ev for ev in events if ev["end"] < now]
-    future = [ev for ev in events if ev["end"] > now]
+    singularity = arrow.utcnow().shift(hours=-2)
+    past = [ev for ev in events if ev["end"] < singularity]
+    future = [ev for ev in events if ev["end"] > singularity]
     return past, future
 
 
-- 
GitLab