将TimePicker添加到已经存在的JqueryDatepicker

时间:2017-01-10 04:36:44

标签: jquery css

我有jquery datepicker。我想将timepicker添加到现有的jquery datepicker

1 个答案:

答案 0 :(得分:0)

在ur html中添加timepicker.js并在jquery下面使用

<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>  
<!-- core, slider, datepicker -->  
<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>  
<script type="text/javascript" src="js/timepicker.js"></script>  

<script type="text/javascript">  
$(function() {  
    $('#datetime').datetimepicker({  
      showSecond: true,
      timeFormat: 'hh:mm:ss',
      stepHour: 2,
      stepMinute: 10,
      stepSecond: 10
      ...  
     });  
});  
</script>  

<input type="text" name="datetime" id="datetime" value="">