FengYuanChen Datepicker


(Richard) #1

Hello,

I’m trying to use the fengyuanchen datepicker in French.
How can I change the langage ? (to fr-FR).

I found the optional information reading the doc, as > language: ‘fr-FR’

I tried to add it on the page : fengyuanchen_datepicker.html
(from Vitor Tutorial)

<script>
  $(function () {
    $("input[name='{{ widget.name }}']").datepicker({
      format:'yyyy-mm-dd', language: 'fr-FR',
    });
  });
</script>

without any results in the form…

Any help will be welcome,
thanks,


(Basil Jose) #2

You must add script https://github.com/fengyuanchen/datepicker/blob/master/i18n/datepicker.fr-FR.js

<script src="/path/to/datepicker.js"></script>
<script src="/path/to/datepicker.fr-FR.js"></script>
<script> $().datepicker({ language: 'fr-FR' }); </script>

(Richard) #3

Thanks !

I finally switched to XDSoft datetimepicker within (.html file)

{% include "django/forms/widgets/input.html" %}
   <script>
  $(function () {
     $("input[name='{{ widget.name }}']").datetimepicker({
       format: 'Y-m-d', 
       timepicker: false,
       dayOfWeekStart: 1,
     });
   });

  $.datetimepicker.setLocale('fr'); 
</script>