On désactive la localisation qui casse tout
This commit is contained in:
parent
a1c7822a74
commit
be324dfcf6
4 changed files with 12 additions and 5 deletions
|
@ -144,7 +144,7 @@ TIME_ZONE = "UTC"
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
USE_L10N = True
|
USE_L10N = False
|
||||||
|
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,11 @@ from fiches.models import Address, Department, Mail, Phone, Profile, Social
|
||||||
|
|
||||||
|
|
||||||
class ProfileForm(forms.ModelForm):
|
class ProfileForm(forms.ModelForm):
|
||||||
|
birth_date = forms.DateField(
|
||||||
|
input_formats=["%Y-%m-%d"],
|
||||||
|
required=False,
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Profile
|
model = Profile
|
||||||
exclude = ["user"]
|
exclude = ["user"]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "fiches/base.html" %}
|
{% extends "fiches/base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n l10n %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
@ -40,7 +40,9 @@
|
||||||
<div class="birthdate">
|
<div class="birthdate">
|
||||||
<span class="label">{% trans "Date de naissance" %}</span>
|
<span class="label">{% trans "Date de naissance" %}</span>
|
||||||
<span class="separator"></span>
|
<span class="separator"></span>
|
||||||
|
{% localize on %}
|
||||||
<span class="value">{{ profile.birth_date }}</span>
|
<span class="value">{{ profile.birth_date }}</span>
|
||||||
|
{% endlocalize %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{% extends "fiches/base.html" %}
|
{% extends "fiches/base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n static %}
|
||||||
{% load static %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
@ -121,7 +120,8 @@
|
||||||
<script>
|
<script>
|
||||||
const elem = document.querySelector('input[name="birth_date"]');
|
const elem = document.querySelector('input[name="birth_date"]');
|
||||||
const datepicker = new Datepicker(elem, {
|
const datepicker = new Datepicker(elem, {
|
||||||
format: "dd/mm/yyyy",
|
format: "yyyy-mm-dd",
|
||||||
|
defaultViewDate: "{% now '%Y-%m-%d' %}",
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue