如何在使用Coldfusion从查询中获取的Jquery datetimepicker中设置开始日期?
我需要在datetimepicker中设置开始日期.我怎样才能做到这一点 ?我检查了minDate和StartDate.但是我无法设置开始日期.请给我一个适当的解决方案.预先感谢.
I need to set a starting date in datetimepicker. how can i do that ? I checked with minDate and StartDate. But i couldn't able to set the starting date. Please give me a propper solution for this. Thanks in advance.
示例代码:
StartDate = new Date("March 20, 2014");
jQuery('.datetimepicker').datetimepicker({step:30});
jQuery('.datetimepicker_notime').datetimepicker({
timepicker:false,
format:'m/d/Y',
minDate : StartDate,
step:30
});
此jQuery插件的 docs (如果您正在使用的话),开始日期可以这样设置:
According to the docs for this jQuery plugin (if this is the one that you are using) the start date can be set like this:
日期时间选择器的开始日期#
Date Time Picker start date #
javaScript
javaScript
jQuery('#datetimepicker_start_time').datetimepicker({
startDate:'1971/05/01'
});
startDate-如果输入值为空,则从该starDate设置日历日期
startDate - if input value is empty, calendar set date from this starDate
示例:
{startDate:'1987/12/03'}
{startDate:new Date()}
{startDate:'+1970/01/02'} // tomorrow
{startDate:'08.12.1986',formatDate:'d.m.Y'}
将其添加到您的示例中,如下所示:
Adding this to your example it would look like this:
StartDate = '2014/03/20';
jQuery('.datetimepicker').datetimepicker({step:30});
jQuery('.datetimepicker_notime').datetimepicker({
timepicker:false,
format:'m/d/Y',
startDate: StartDate,
step:30
});