How to set the date in materialize datepicker

后端 未结 10 1254
长发绾君心
长发绾君心 2020-12-05 09:36

I am using materializecss.com Datepicker. When i try to set date with jquery, the date doesn\'t get set. Here is my Code :-

// Materialize Date Picker
    wi         


        
10条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-05 10:32

    You can use methods of datepicker which are present in V1.0.0-rc.2.

    
    

    defaultDate will set a default Date that will be shown in input-field of datepicker without even opening the picker.

    instance.setDate() will select the date in datepicker when you'll open it.

    Note- new Date(year, monthIndex [, day [, hours [, minutes [, seconds [, milliseconds]]]]]);

    The argument monthIndex is 0-based. This means that January = 0 and December = 11

    Picker - Materialize

    MDN - Date

提交回复
热议问题