From be324dfcf6a46102b4d471464d5aed136a10a44b Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Fri, 29 Jan 2021 23:26:59 +0100 Subject: [PATCH] =?UTF-8?q?On=20d=C3=A9sactive=20la=20localisation=20qui?= =?UTF-8?q?=20casse=20tout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- annuaire/settings.py | 2 +- fiches/forms.py | 5 +++++ fiches/templates/fiches/fiche.html | 4 +++- fiches/templates/fiches/fiches_modif.html | 6 +++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/annuaire/settings.py b/annuaire/settings.py index 08fcbb1..1e60d22 100644 --- a/annuaire/settings.py +++ b/annuaire/settings.py @@ -144,7 +144,7 @@ TIME_ZONE = "UTC" USE_I18N = True -USE_L10N = True +USE_L10N = False USE_TZ = True diff --git a/fiches/forms.py b/fiches/forms.py index b8f9782..ebbd29a 100644 --- a/fiches/forms.py +++ b/fiches/forms.py @@ -6,6 +6,11 @@ from fiches.models import Address, Department, Mail, Phone, Profile, Social class ProfileForm(forms.ModelForm): + birth_date = forms.DateField( + input_formats=["%Y-%m-%d"], + required=False, + ) + class Meta: model = Profile exclude = ["user"] diff --git a/fiches/templates/fiches/fiche.html b/fiches/templates/fiches/fiche.html index 68a7292..201a7b2 100644 --- a/fiches/templates/fiches/fiche.html +++ b/fiches/templates/fiches/fiche.html @@ -1,5 +1,5 @@ {% extends "fiches/base.html" %} -{% load i18n %} +{% load i18n l10n %} {% block content %} @@ -40,7 +40,9 @@
{% trans "Date de naissance" %} + {% localize on %} {{ profile.birth_date }} + {% endlocalize %}
{% endif %} diff --git a/fiches/templates/fiches/fiches_modif.html b/fiches/templates/fiches/fiches_modif.html index 8a3220e..493806d 100644 --- a/fiches/templates/fiches/fiches_modif.html +++ b/fiches/templates/fiches/fiches_modif.html @@ -1,6 +1,5 @@ {% extends "fiches/base.html" %} -{% load i18n %} -{% load static %} +{% load i18n static %} {% block content %} @@ -121,7 +120,8 @@