Skip to content
Snippets Groups Projects
Commit ad7d9ac2 authored by jan.bednarik's avatar jan.bednarik
Browse files

calendar utils: Split events shifted by 2h

parent b9eee398
Branches
No related tags found
2 merge requests!347release,!346calendar utils: Split events shifted by 2h
Pipeline #4833 passed
...@@ -18,9 +18,9 @@ def parse_ical(source): ...@@ -18,9 +18,9 @@ def parse_ical(source):
def split_events(events): def split_events(events):
"""Splits events and returns list of past events and future events.""" """Splits events and returns list of past events and future events."""
now = arrow.utcnow() singularity = arrow.utcnow().shift(hours=-2)
past = [ev for ev in events if ev["end"] < now] past = [ev for ev in events if ev["end"] < singularity]
future = [ev for ev in events if ev["end"] > now] future = [ev for ev in events if ev["end"] > singularity]
return past, future return past, future
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment