kendo DatePicker 中是否有任何默认方法可以确保 To 日期始终大于或等于 From 日期。这是我尝试过的代码:
我的范围选择代码:
function startChange() {
var startDate = startdatetimepicker.value(),
endDate = enddatetimepicker.value();
if (startDate) {
startDate = new Date(startDate);
startDate.setDate(startDate.getDate());
enddatetimepicker.min(startDate);
} else if (endDate) {
startdatetimepicker.max(new Date(endDate));
} else {
endDate = new Date();
startdatetimepicker.max(endDate);
enddatetimepicker.min(endDate);
}
}
function endChange() {
var endDate = enddatetimepicker.value(),
startDate = startdatetimepicker.value();
if (endDate) {
endDate = new Date(endDate);
endDate.setDate(endDate.getDate());
startdatetimepicker.max(endDate);
} else if (startDate) {
enddatetimepicker.min(new Date(startDate));
} else {
endDate = new Date();
startdatetimepicker.max(endDate);
enddatetimepicker.min(endDate);
}
}
我收到此错误-->“属性‘值’od 对象 3 不是函数”