Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Materializecss datepicker not working

I am using materializecss for the first time in my web application and I am struggling with datepicker. It is not working at all.

I imported materialize.css and js file and use the code

<div>
 <input type="date"  class="datepicker" />
</div>

and added script code

 $(document).ready(function() {
    $('select').material_select();


    window.picker = $('.datepicker').pickadate({

        selectYears: 16, // Creates a dropdown of 15 years to control year
        format: 'yyyy-mm-dd'
    });



});

but nothing worked, it shows a disabled text box.

Also I want to know how to add timepicker in materializecss?

like image 429
Sibin Francis Avatar asked Mar 12 '16 09:03

Sibin Francis


1 Answers

I had the same problem. My problem was solved with downgrading jquery to 2.1.4. It seems, that on some reason the datetimepicker and jquery 2.2.1 are not working together.

cheers Thomas

like image 77
Thomas Avatar answered Oct 12 '22 06:10

Thomas