layDate设置开始日期选择框和结束日期选择框 之间的相互验证方法
阅读原文时间:2023年07月10日阅读:2

var startDate = laydate.render({
elem: '#_select_start_date', //结束日期框的ID
type: 'date',
done: function (value, date) {
if(value!==""){
endDate.config.min = {
year:date.year,
month:date.month-1,
date: date.date
}
}else
{
endDate.config.min = {
year:"1098",
month:"1",
date: "1"
}
}
},
trigger: 'click'
});
var endDate = laydate.render({
elem:'#_select_end_date', //结束日期框的ID
type:'date',
done:function(value,date){
if(value!==""){
startDate.config.max={
year:date.year,
month:date.month-1,
date: date.date
};
}else {
startDate.config.max={
year:"3019",
month:"1",
date: "1"
};
}
},
trigger: 'click'
});