Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
236 views
in Technique[技术] by (71.8m points)

Datepicker in Materialize doesn't update month

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...