Bootstrap datetimepicker startDate does not disable past dates

后端 未结 3 1110
时光取名叫无心
时光取名叫无心 2021-01-15 13:25

I use bootstrap datetimepicker and I want to disable the past days but startDate option did not work:

var now = new Date();
var tomorrow = now.g         


        
3条回答
  •  心在旅途
    2021-01-15 14:08

    You probably need to use the minDate option of the datetimepicker:

    var tomorrow = new Date();
    tomorrow.setDate(tomorrow.getDate() + 1);
    $("#end_at").datetimepicker({
        format: 'YYYY-MM-DD HH:mm:ss',
        minDate: tomorrow
    });
    

提交回复
热议问题