1

我将 controlType 设置为'select',并将 minDateTime 设置"2015/03/04 20:15"#datetimepicker,当我单击它时,对于一天中的每个小时不能选择小于 15 的分钟数。

jQuery datetimepicker 选项 minDateTime 错误?还是我的方式不对?

$("#datetimepicker").datetimepicker({
  minDateTime: new Date("2015/03/04 20:15"),
  controlType: 'select'
});
/* css for timepicker */

.ui-timepicker-div .ui-widget-header {
  margin-bottom: 8px;
}

.ui-timepicker-div dl {
  text-align: left;
}

.ui-timepicker-div dl dt {
  float: left;
  clear: left;
  padding: 0 0 0 5px;
}

.ui-timepicker-div dl dd {
  margin: 0 10px 10px 45%;
}

.ui-timepicker-div td {
  font-size: 90%;
}

.ui-tpicker-grid-label {
  background: none;
  border: none;
  margin: 0;
  padding: 0;
}

.ui-timepicker-rtl {
  direction: rtl;
}

.ui-timepicker-rtl dl {
  text-align: right;
  padding: 0 5px 0 0;
}

.ui-timepicker-rtl dl dt {
  float: right;
  clear: right;
}

.ui-timepicker-rtl dl dd {
  margin: 0 45% 10px 10px;
}
<script src="http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" /> Date: <input type="text" id="datetimepicker" />

4

2 回答 2

1

也许试试这个语法。

$( "#datetimepicker" ).datetimepicker({
    minDate: new Date(),
    controlType:'select'
});
于 2015-08-29T13:10:25.897 回答
0

我会看看你创建日期的方式(http://www.w3schools.com/js/js_dates.asp

此外,除了“minDateTime”选项之外,尝试使用相同(正确)的日期值添加“minDate”选项。

于 2014-07-11T14:02:52.233 回答