我的输入字段如下 -
<input type="text" maxlength="8" placeholder="" class="time-icn form-control ui-timepicker-input valid" name="ReminderTime" id="ReminderTime" class="ReminderTime" value="" autocomplete="off">
按照以下
添加时间选择器$("#ReminderTime").timepicker({
"showDuration": true,
"timeFormat": "g:i A",
"step": 15,
"forceRoundTime": true,
"maxTime": "11:45pm",
"className": "timepicker-width",
"scrollDefault": "now",
});
我到底做了什么?
答案 0 :(得分:0)
获取date.getHours()
和分钟date.getMinutes()
的当前小时,然后将其设置为minTime
,我删除maxTime
以选择今天的剩余时间,而不是{{1} },使用step
,您的interval
错误。
timeFormat
&#13;
var date = new Date();
var hour = date.getHours();
var minute = date.getMinutes();
$("#ReminderTime").timepicker({
"showDuration": true,
"interval": 15,
"timeFormat": "h:mm p",
"forceRoundTime": true,
"minTime": "" + hour + ":" + minute + "",
"className": "timepicker-width",
"scrollDefault": "now",
});
&#13;