我使用过jquery-simple-datetimepicker
在这里
https://github.com/mugifly/jquery-simple-datetimepicker
我的代码是
<input name="day_time" id="day_time_input" type="text" value="" />
jQuery(function () {
jQuery('#day_time_input').appendDtpicker();
});
现在想阻止用户选择过去的日期。
那怎么办?
答案 0 :(得分:1)
尝试:datepicker
是您的元素ID
$("#day_time_input").datetimepicker({
minDate: 0
});
答案 1 :(得分:1)
<script type="text/javascript">
$(function(){
$('*[name=date1]').appendDtpicker({
"closeOnSelected": true,
"futureOnly": true
});
});
</script>
使用futureOnly
答案 2 :(得分:1)
查找
var getDefaults = function() {
return {
"current": null,
"dateFormat": "default",
"locale": "en",
"animation": true,
"minuteInterval": 30,
"firstDayOfWeek": 0,
"closeOnSelected": false,
"timelistScroll": true,
"calendarMouseScroll": true,
"todayButton": true,
"dateOnly": false,
"futureOnly": false,
"minDate" : null,
"maxDate" : null,
"autodateOnStart": true,
"minTime":"00:00",
"maxTime":"23:59",
"onShow": null,
"onHide": null
};
};
并更改
"futureOnly": true
从假到真。
答案 3 :(得分:1)
您要添加 futureOnly:true
$("#div").appendDtpicker({
futureOnly: true
});