From 5ef9358b28b1bbc136dc7cc2d240cb6f00013f1a Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Thu, 12 Dec 2024 00:41:44 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20navigation=20semaines=20au=20changement?= =?UTF-8?q?=20d'ann=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/agenda_culturel/page-week.html | 8 ++++---- src/agenda_culturel/templatetags/utils_extra.py | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/agenda_culturel/templates/agenda_culturel/page-week.html b/src/agenda_culturel/templates/agenda_culturel/page-week.html index 9136e32..e56dd92 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-week.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-week.html @@ -37,7 +37,7 @@
{% if calendar.firstdate|shift_day:-1|not_before_first %} {% if calendar.lastdate|not_after_last %} - + {% picto_from_name "chevron-left" %} précédente {% endif %} {% endif %} @@ -45,7 +45,7 @@ {% if calendar.lastdate|shift_day:+1|not_after_last %} {% if calendar.lastdate|not_before_first %} @@ -57,7 +57,7 @@ {% if calendar.firstdate|shift_day:-1|not_before_first %} {% if calendar.lastdate|not_after_last %} - + {% endif %} {% endif %} @@ -166,7 +166,7 @@ {% if calendar.lastdate|shift_day:+1|not_after_last %} {% if calendar.lastdate|not_before_first %} - + {% endif %} {% endif %} diff --git a/src/agenda_culturel/templatetags/utils_extra.py b/src/agenda_culturel/templatetags/utils_extra.py index a2df4f3..4ea4bf2 100644 --- a/src/agenda_culturel/templatetags/utils_extra.py +++ b/src/agenda_culturel/templatetags/utils_extra.py @@ -29,6 +29,9 @@ def add_de(txt): def week(d): return d.isocalendar()[1] +@register.filter +def weekyear(d): + return d.isocalendar()[0] @register.filter def not_before_first(d):