gpt4 book ai didi

javascript - Bootstrap datetimepicker startDate 不会禁用过去的日期

转载 作者:行者123 更新时间:2023-11-30 07:58:49 38 4
gpt4 key购买 nike

我使用 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日期时间选择器的选项:

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

关于javascript - Bootstrap datetimepicker startDate 不会禁用过去的日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33210085/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com