Show days until holiday on holidays page

This commit is contained in:
Edward Betts 2024-01-19 20:47:03 +00:00
parent e16e04ab51
commit cd60ebdea2
2 changed files with 3 additions and 2 deletions

View file

@ -10,8 +10,9 @@
<tr> <tr>
{% if loop.first or item.date != loop.previtem.date %} {% if loop.first or item.date != loop.previtem.date %}
<td class="text-end">{{ display_date(item.date) }}</td> <td class="text-end">{{ display_date(item.date) }}</td>
<td>in {{ (item.date - today).days }} days</td>
{% else %} {% else %}
<td></td> <td colspan="2"></td>
{% endif %} {% endif %}
<td>{{ country.flag }} {{ country.name }}</td> <td>{{ country.flag }} {{ country.name }}</td>
<td>{{ item.display_name }}</td> <td>{{ item.display_name }}</td>

View file

@ -293,7 +293,7 @@ def holiday_list() -> str:
items.sort(key=lambda item: (item.date, item.country)) items.sort(key=lambda item: (item.date, item.country))
return flask.render_template( 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
) )