disable past dates on datepicker

前端 未结 22 1304
梦毁少年i
梦毁少年i 2020-11-29 06:03

How to disable past dates from the current date on a datetimepicker? I tried few posts for similar question but was unable to achieve it, Below is what I tried



        
22条回答
  •  悲哀的现实
    2020-11-29 06:20

    minDate: dateToday Or minDate: '0' is the key here. Try to set the minDate property.

    $(function() {
        $( "#datepicker" ).datepicker({
            numberOfMonths: 2,
            showButtonPanel: true,
            minDate: dateToday // minDate: '0' would work too
        });
    });
    

    Read more

提交回复
热议问题