我正在为 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 等有谁知道我可以如何编码?