How do I clear/reset the selected dates on the jQuery UI Datepicker calendar?

后端 未结 16 1650
感情败类
感情败类 2020-12-02 07:19

How do I reset the datepicker calendar values?.. The min and max date restrictions?

The problem is that when I clear the dates (by deleting the textbox values), th

16条回答
  •  长情又很酷
    2020-12-02 07:58

    I use this code to clear the field and all shenannigans. I Needed an empty field for my use case

    jQuery.datepicker._clearDate(window.firstDay);
    window.firstDay.datepicker('setDate',null);
    window.firstDay[0].value = '';
    

    For some reason .val('') wouldn't work for me. But bypassing jQuery did it. In my opinion its a flaw that there is no .datepicker('clear') option.

提交回复
热议问题