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 %} {% if event.start_time %} {% if not event.end_day %}{% if event.end_time %}de{% else %}à{% endif %}{% endif %}
{{ event.start_time }} {{ event.start_time }}
{% endif %} {% endif %}
{% if event.end_day %} {% 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 %} {% 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 %} {% endblock %}
{% block title %} {% block title %}
{{ day | date:"l j F Y" }} {{ day | date:"l j F Y"|frdate }}
{% endblock %} {% endblock %}
@ -31,7 +31,7 @@
<div> <div>
<article> <article>
<header> <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 class="navigation">
<div> <div>
{% with day|shift_day:-1 as pred_day %} {% with day|shift_day:-1 as pred_day %}

View File

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

View File

@ -84,3 +84,7 @@ def truncatechars_middle(value, arg):
return value return value
else: 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:]