From cd60ebdea211108010483fca5e9ff6f1871220aa Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 19 Jan 2024 20:47:03 +0000 Subject: [PATCH] Show days until holiday on holidays page --- templates/holiday_list.html | 3 ++- web_view.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/holiday_list.html b/templates/holiday_list.html index a8d3e73..de544e4 100644 --- a/templates/holiday_list.html +++ b/templates/holiday_list.html @@ -10,8 +10,9 @@ {% if loop.first or item.date != loop.previtem.date %} {{ display_date(item.date) }} + in {{ (item.date - today).days }} days {% else %} - + {% endif %} {{ country.flag }} {{ country.name }} {{ item.display_name }} diff --git a/web_view.py b/web_view.py index 2604353..99e5cf7 100755 --- a/web_view.py +++ b/web_view.py @@ -293,7 +293,7 @@ def holiday_list() -> str: items.sort(key=lambda item: (item.date, item.country)) return flask.render_template( - "holiday_list.html", items=items, get_country=agenda.get_country + "holiday_list.html", items=items, get_country=agenda.get_country, today=today )