我使用 bootstrap datetimepicker 并且我想禁用过去的日子,但是startDate
选项不起作用:
var now = new Date();
var tomorrow = now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + (now.getDate() + 1) + " " + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds();
$('#end_at').datetimepicker({
format: 'YYYY-MM-DD hh:mm:ss',
startDate: tomorrow
});
您可能需要使用minDate日期选项timepicker:
var tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
$("#end_at").datetimepicker({
format: 'YYYY-MM-DD HH:mm:ss',
minDate: tomorrow
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)