BobBowles / django-diary

A diary app for use in the django framework.
MIT License
19 stars 3 forks source link

EntryForm DateWidge not working good with internationalization #4

Open kevin-sgcib opened 3 years ago

kevin-sgcib commented 3 years ago

I am in Japan and the date widget is not happy with my regional settings. I can pick a date, but when I try to validate the form (through clicking in 'save'), it says 'input a valid date'. I didn't have much time to look into it so I just added a line to your datewidget initialization :

        'date': DateWidget(
            bootstrap_version=3,
            options=DATE_WIDGET_OPTIONS,
        ),

became

        'date': DateWidget(
            bootstrap_version=3,
            options=DATE_WIDGET_OPTIONS,
            usel10n = True,
        ),

Now the date are not displayed using my local preferences, but it works.

BobBowles commented 3 years ago

Thanks for the feedback. I did not spend much time looking at internationalisation issues when I wrote this. Hopefully when I have time I will incorporate your suggestion.