From dae74f0b7c9e5cee62dcbce3f719e0ea6cc9b715 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 5 Nov 2023 12:36:05 +0000 Subject: [PATCH] Agenda list to include past events from the previous week --- agenda/__init__.py | 1 + templates/index.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agenda/__init__.py b/agenda/__init__.py index 61692d5..491ff6b 100644 --- a/agenda/__init__.py +++ b/agenda/__init__.py @@ -493,6 +493,7 @@ def get_data(now: datetime) -> typing.Mapping[str, str | object]: events.sort(key=operator.attrgetter("as_datetime")) reply["events"] = events + reply["last_week"] = today - timedelta(weeks=1) reply["fullcalendar_events"] = calendar.build_events(events) diff --git a/templates/index.html b/templates/index.html index 5651d54..9b85c44 100644 --- a/templates/index.html +++ b/templates/index.html @@ -113,7 +113,7 @@

Agenda

- {% for event in events %} + {% for event in events if event.as_date >= last_week %}
{{event.as_date.strftime("%a, %d, %b")}}