【发布时间】:2019-02-05 05:48:18
【问题描述】:
我正在使用引导日期时间选择器,其文档可在此处找到:https://eonasdan.github.io/bootstrap-datetimepicker/Options/
我正在尝试将所选日期设置为空。我可以在输入字段中清除日期(即 2/10/2019),但是当我单击输入字段并打开日历时,旧日期仍以蓝色选择。 WiThis 是我取消选择日历中所有日期的代码。
$(document).ready(function() {
$('.removedate').on('click', function(){
$("#id_booking_date").val('') //this correctly removes date from input field
$('.input-group').datetimepicker({
date: new Date(null)
});
});
此代码无效。你知道我应该尝试什么吗?
谢谢!
【问题讨论】:
-
你能用html分享你的代码吗
-
我只是在使用标准的 datetimepicker 功能。我的html看起来像eonasdan.github.io/bootstrap-datetimepicker/Options首页示例上的html
-
也看看this question。
标签: javascript bootstrap-datetimepicker