I'm working on a Symfony project (organizer of events) and I'm trying to build a datepicker with Materialize in my form.
I can change the day with it, I can change the Year but i can't change the month and I don't understand why (the mnth is alway "1", so I suppose the current month).
This is my jquery in my twig for the form :
$('.datepicker').datepicker({
yearRange: [currYear, currYear + 1],
format: "dd-mm-yyyy",
i18n: {
months: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Ao?t", "Septembre", "Octobre", "Novembre", "Décembre"],
monthsShort: ["Jan", "Fév", "Mar", "Avr", "Mai", "Jun", "Jui", "Ao?", "Sep", "Oct", "Nov", "Déc"],
weekdays: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"],
weekdaysShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"],
weekdaysAbbrev: ["D", "L", "M", "M", "J", "V", "S"]
}
});
And this is my $builder in my EventType :
->add('dateEvent', DateType::class, [
'widget' => 'single_text',
'html5' => false,
'format' => 'dd-mm-yyyy',
'attr' => ['class' => 'datepicker']])
Please help me for this :-)
Thanks a lot,
Sophie
question from:
https://stackoverflow.com/questions/65870311/datepicker-in-materialize-doesnt-update-month