From 316f61548478aa34aaadff32c222410e8ae4a900 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Tue, 28 Mar 2017 17:11:49 +0200 Subject: [PATCH] Use locale fr for datetime picker --- refunding/forms.py | 6 ++++-- refunding/templates/refunding/refund_payment_detail.html | 2 +- refunds/settings.py | 4 ++-- requirements.txt | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/refunding/forms.py b/refunding/forms.py index 3b298b9..23a446c 100644 --- a/refunding/forms.py +++ b/refunding/forms.py @@ -44,7 +44,8 @@ class RefundFormPublic(RefundForm): date = forms.DateField( widget=DateTimePicker( options={ - 'format': 'YYYY-MM-DD' + 'format': 'YYYY-MM-DD', + "locale": "fr", } ) ) @@ -57,7 +58,8 @@ class PaymentForm(forms.ModelForm): widgets = { 'date': DateTimePicker( options={ - "format": "YYYY-MM-DD" + 'format': 'YYYY-MM-DD', + "locale": "fr", } ), } diff --git a/refunding/templates/refunding/refund_payment_detail.html b/refunding/templates/refunding/refund_payment_detail.html index 844ffe5..e81fa59 100644 --- a/refunding/templates/refunding/refund_payment_detail.html +++ b/refunding/templates/refunding/refund_payment_detail.html @@ -4,7 +4,7 @@ {% block javascript %} {{ block.super }} - diff --git a/refunds/settings.py b/refunds/settings.py index f0c4ad9..85fec5e 100644 --- a/refunds/settings.py +++ b/refunds/settings.py @@ -129,9 +129,9 @@ AUTH_PASSWORD_VALIDATORS = [ # Internationalization # https://docs.djangoproject.com/en/1.9/topics/i18n/ -LANGUAGE_CODE = os.getenv('DJANGO_LOCALE', 'en-us') +LANGUAGE_CODE = os.getenv('DJANGO_LOCALE', 'fr-fr') -TIME_ZONE = os.getenv('DJANGO_TIMEZONE', 'UTC') +TIME_ZONE = os.getenv('DJANGO_TIMEZONE', 'Europe/Paris') USE_I18N = True diff --git a/requirements.txt b/requirements.txt index 5f0f3eb..04dfc95 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ django-crispy-forms==1.6.0 django-dotenv==1.4.1 gunicorn==19.6.0 psycopg2==2.6.2 +pytz whitenoise==3.2.1