$("#startdate").datetimepicker({dateFormat: 'yy-mm-dd', showStatus : true, changeMonth: true, changeYear: true, onClose: function(dateText, inst) { $("#enddate").focus(); //可以弹出结束时间,但是无法关闭 $("#enddate").trigger(function(){}); //无法弹出结束时间,同时使用才能弹出并正常关闭 }});
$("#enddate").datetimepicker({dateFormat: 'yy-mm-dd', showStatus : true, changeMonth: true, changeYear: true, hour: 23, minute: 59});
所以弹出日期选择框是通过获得焦点,不是通过点击事件