如何减少时间(从早上9点到下午5点)? Timepicker插件

时间:2012-09-24 10:34:20

标签: jquery jquery-ui jquery-ui-datepicker jquery-ui-timepicker

我使用http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.js

这是我的代码:

<script type="text/javascript">
$(document).ready(function(){
$('#time').datetimepicker({ showSecond: false,dateFormat: 'yy-mm-dd',timeFormat: 'hh:mm',minDate: new Date() });
});
</script>

.......

<p><label for="id_time">Date:</label> <input type="text" name="time" id="time" /></p>

.......

如何减少时间(从早上9点到下午5点)?

1 个答案:

答案 0 :(得分:1)

http://trentrichardson.com/examples/timepicker/#rest_examples

$('#time').timepicker({
    ampm: true,
    hourMin: 9,
    hourMax: 17
});