Materialize.css datepicker: offset in month display

17 views Asked by At

I'm having a problem with a datepicker under materialize 1.0.0

Here is the HTML code :

<input id="date_echeance" value="" type="date" class="datepicker" name="date_echeance" required="required" aria-required="true">

Here is the Javascript code :

var datepickerOptions = {
    format: 'yyyy-mm-dd',
    disableWeekends: false,
    autoclose: true,
    firstDay: 1,
    showDaysInNextAndPreviousMonths: true,
    showClearBtn: true,
    i18n: {
         cancel: "Annuler",
         clear: "Effacer",
         done: "Valider",
         months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
         monthsShort: ['Jan.', 'Fév.', 'Mars', 'Avr.', 'Juin', 'Juil.', 'Août', 'Sept.', 'Oct.', 'Nov.', 'Déc.'],
         weekdays: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
         weekdaysShort: ['Dim', 'Lun', 'Mar', 'Merc', 'Jeu', 'Ven', 'Sam'],
         weekdaysAbbrev: ['D', 'L', 'M', 'Me', 'J', 'V', 'S']
    }
};
M.Datepicker.init($('.datepicker'), datepickerOptions);

It turns out that with this configuration, when I click on September 15, 2023, the value is indeed September 15, 2023 (2023-09-15), but it shows me "Ven, Oct 15" in the control panel left, instead of "Ven, Sept. 15"!

However, I would have even preferred it to display “Ven 15 Sept.”

Any idea what my mistake was?

0

There are 0 answers