conversion 1 -> 1er

This commit is contained in:
Jean-Marie Favreau 2024-04-05 13:24:20 +02:00
parent 7a6cd5737c
commit 3fa01d7bf4
4 changed files with 15 additions and 9 deletions

View File

@ -1,8 +1,10 @@
{{ event.start_day }}
{% load utils_extra %}
{{ event.start_day|date|frdate }}
{% if event.start_time %} {% if not event.end_day %}{% if event.end_time %}de{% else %}à{% endif %}{% endif %}
{{ event.start_time }}
{% endif %}
{% if event.end_day %}
au {% if event.end_day %}{{ event.end_day }}{% endif %}
au {% if event.end_day %}{{ event.end_day|date|frdate }}{% endif %}
{% endif %}
{% if event.end_time %} {% if not event.end_day %}jusqu'à{% endif %} {{ event.end_time }}{% endif %}
{% if event.end_time %} {% if not event.end_day|date|frdate %}jusqu'à{% endif %} {{ event.end_time }}{% endif %}

View File

@ -16,7 +16,7 @@
{% endblock %}
{% block title %}
{{ day | date:"l j F Y" }}
{{ day | date:"l j F Y"|frdate }}
{% endblock %}
@ -31,7 +31,7 @@
<div>
<article>
<header>
<div class="title"><h1>{{ day | date:"l j F Y" }}</h1></div>
<div class="title"><h1>{{ day | date:"l j F Y"|frdate }}</h1></div>
<div class="navigation">
<div>
{% with day|shift_day:-1 as pred_day %}

View File

@ -8,7 +8,7 @@
{% load event_extra %}
{% load utils_extra %}
{% load static %}
{% load i18n %}
{% block entete_header %}
{% css_categories %}
@ -17,7 +17,7 @@
{% endblock %}
{% block title %}
Semaine du {{ calendar.calendar_days_list.0.date }}
Semaine du {{ calendar.calendar_days_list.0.date|date|frdate }}
{% endblock %}
{% block content %}
@ -31,7 +31,7 @@ Semaine du {{ calendar.calendar_days_list.0.date }}
<article>
<header>
<div class="title"><h1>Semaine du {{ calendar.calendar_days_list.0.date }}</h1></div>
<div class="title"><h1>Semaine du {{ calendar.calendar_days_list.0.date |date|frdate }}</h1></div>
<div class="navigation">
<div>
<a role="button" href="{% url 'week_view' calendar.previous_week.year calendar.previous_week|week %}?{{ filter.get_url }}">

View File

@ -83,4 +83,8 @@ def truncatechars_middle(value, arg):
if len(value) <= ln:
return value
else:
return '{}...{}'.format(value[:ln//2], value[-((ln+1)//2):])
return '{}...{}'.format(value[:ln//2], value[-((ln+1)//2):])
@register.filter
def frdate(d):
return ('!' + d).replace(" 1 ", " 1er ").replace("!1 ", "!1er ")[1:]