我想在这个程序中选择两个日期,如果我尝试执行它显示:
datepicker不是函数
代码:
var startDate;
$("#validFrom").datetimepicker({
timepicker: true,
closeOnDateSelect: false,
closeOnTimeSelect: true,
initTime: true,
format: 'd-m-Y H:m',
minDate: 0,
roundTime: 'ceil',
onChangeDateTime: function (dp, $input) {
startDate = $("#validFrom").val();
}
});
$("#validTill").datetimepicker({
timepicker: true,
closeOnDateSelect: false,
closeOnTimeSelect: true,
initTime: true,
format: 'd-m-Y H:m',
onClose: function (current_time, $input) {
var endDate = $("#validTill").val();
if (startDate > endDate) {
alert('Please select correct date');
}
}
});