From ff15f380fabe78d2cf2b877805f072dfb58092d6 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 5 Mar 2024 12:28:34 +0100 Subject: [PATCH] Consider current trips for free weekends list Closes: #138 --- agenda/data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agenda/data.py b/agenda/data.py index 3e3efa0..65a7731 100644 --- a/agenda/data.py +++ b/agenda/data.py @@ -313,7 +313,9 @@ def get_busy_events( busy_events = [ e for e in sorted(events, key=lambda e: e.as_date) - if e.as_date > today and e.as_date < next_year and busy_event(e) + if (e.as_date >= today or (e.end_date and e.end_as_date >= today)) + and e.as_date < next_year + and busy_event(e) ] return busy_events