var start = laydate.render({
elem: '#startTime',
format: 'yyyy-MM-dd',
// isInitValue: true,
// value: startTime,
// min: endTime, //设定最小日期为当前日期
// max: '2099-06-16', //最大日期
max: endTime,
istime: true, //是否开启时间选择
istoday: true, //是否显示今天
done: function (value, date) {
// 开始日选好后,重置结束日的最小日期 min及start
end.config.min = {
year: date.year,
month: date.month - 1,
date: date.date,
};
end.config.start = {
year: date.year,
month: date.month - 1,
date: date.date,
};
}
});
var end = laydate.render({
elem: '#endTime',
format: 'yyyy-MM-dd',
// isInitValue: true,
// value: endTime,
max: endTime,
istime: true,
istoday: true,
done: function(value, date) {
//结束日选好后,重置开始日的最大日期 max
start.config.max = {
year: date.year,
month: date.month - 1,
date: date.date,
}
}
});