我在我的视图(JS)中有这个代码:
$("#mydivelement").timepicker();
它不仅仅是timepicker,而是显示datetimepicker。如果重要的话,我在布局页面中设置了datepicker默认值:
$.datepicker.setDefaults({
dateFormat: 'dd/mm/yy',
yearRange: '1930:2012',
changeYear: true,
changeMonth: true,
autoSize: true,
showAnim: 'slideDown',
firstDay: 1
});
更新:使用Library-jquery-ui-timepicker-addon.js
答案 0 :(得分:5)
您错过了将{}
添加到.timepicker()
<强> Jquery的强>
$(function() {
$( "#mydivelement" ).datepicker({
dateFormat: 'dd/mm/yy',
yearRange: '1930:2012',
changeYear: true,
changeMonth: true,
autoSize: true,
showAnim: 'slideDown',
firstDay: 1
});
$('#timepicker').timepicker({}); // it shows only timepicker without datepicker
});