diff --git a/taiga/front/templatetags/functions.py b/taiga/front/templatetags/functions.py index 2177afe6..4810715f 100644 --- a/taiga/front/templatetags/functions.py +++ b/taiga/front/templatetags/functions.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from datetime import datetime +import datetime as dt from django_jinja import library from django_sites import get_by_id as get_site_by_id @@ -34,7 +34,7 @@ def resolve(type, *args): return url_tmpl.format(scheme=scheme, domain=site.domain, url=url) -@library.filter(name="date") -def format_date(value, *args): - date_value = datetime.strptime(value, '%Y-%m-%d') +@library.filter(name="parse_and_format_date") +def parse_and_format_date(value, *args): + date_value = dt.datetime.strptime(value, '%Y-%m-%d') return date_value.strftime('%d %b %Y') diff --git a/taiga/projects/history/templates/emails/includes/fields_diff-html.jinja b/taiga/projects/history/templates/emails/includes/fields_diff-html.jinja index 2e6138e7..452c7f92 100644 --- a/taiga/projects/history/templates/emails/includes/fields_diff-html.jinja +++ b/taiga/projects/history/templates/emails/includes/fields_diff-html.jinja @@ -149,7 +149,7 @@ {% endif %} - {# ASSIGNED TO #} + {# DUE DATE #} {% elif field_name == "due_date" %} @@ -158,7 +158,7 @@ {% if values.0 != None and values.0 != "" %} {{ _("from") }}
- {{ values.0|date }} + {{ values.0|parse_and_format_date }} {% else %} {{ _("from") }}
{{ _("Not set") }} @@ -169,7 +169,7 @@ {% if values.1 != None and values.1 != "" %} {{ _("to") }}
- {{ values.1|date }} + {{ values.1|parse_and_format_date }} {% else %} {{ _("to") }}
{{ _("Not set") }}