【发布时间】:2014-03-13 21:50:42
【问题描述】:
我正在为 JQuery Datepicker 使用 Trent Richardsons Timepicker 插件,我需要能够限制我们的用户可以选择的时间。
到目前为止我的代码:
$('.datepicker').datetimepicker({
showOn: "both",
buttonImage: "/images/icons/cal-clock-icon-16x16.png",
buttonImageOnly: true,
showButtonPanel: true,
changeMonth: true,
changeYear: true,
hourMin: 8,
hourMax: 16,
stepMinute: 15,
minuteGrid: 15,
addSliderAccess: true,
sliderAccessArgs: {touchonly: false},
altField: "#testTime",
altFieldTimeOnly: false,
altFormat: "yy-mm-dd",
altTimeFormat : "HH:mm:ss",
dateFormat: "D, d MM yy",
timeFormat: "hh:mmtt"
});
所以我有最小和最大小时数,我会根据需要每隔 15 分钟跳一次,但我不想让他们预订某些特定的分钟数。因此,例如,我不希望他们选择 8:15、8:45、9:15、9:45、10:00、10:15 等有谁知道我如何编码?
【问题讨论】:
标签: jquery jquery-ui datepicker jquery-ui-timepicker