本文介绍了如何在datetimepicker引导程序中禁用今天之前的日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
演示和完整代码如下: http://fiddle.jshell.net/oscar11 /dgb09c5c/5/
Demo and full code is like this : http://fiddle.jshell.net/oscar11/dgb09c5c/5/
我的Javascript代码如下:
My Javascript code is like this :
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd hh:ii:ss',
autoclose: true,
pickerPosition: "bottom-left",
maxView: 3,
minuteStep: 1,
minDate: new Date()
})
如何禁用今天之前的日期?
How to disable date before today?
我添加了minDate: new Date()
,但是它不起作用
I add minDate: new Date()
, but it's not working
有什么解决方案可以解决我的问题?
Any solution to solve my problem?
推荐答案
$.fn.datetimepicker.defaults = {
maskInput: true, // disables the text input mask
pickDate: true, // disables the date picker
pickTime: true, // disables de time picker
pick12HourFormat: false, // enables the 12-hour format time picker
pickSeconds: true, // disables seconds in the time picker
startDate: -Infinity, // set a minimum date
endDate: Infinity // set a maximum date
};
我修改了您的小提琴.是您要找的东西吗? http://fiddle.jshell.net/dgb09c5c/6/
I modified your Fiddle. Is it what you are looking for? http://fiddle.jshell.net/dgb09c5c/6/
这篇关于如何在datetimepicker引导程序中禁用今天之前的日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!