近期写时间验证,使用laydate ,验证开始时间和结束时间之间的时间验证
特此记录
var startTime = laydate.render({
elem: '#RDSJ',
type: 'date',
done: function (value, date) {
debugger
if(value!==""){
endTime.config.min = {
year:date.year,
month:date.month-1,//关键
date: date.date
}
}else
{
endTime.config.min = {
year:"1098",
month:"1",
date: "1"
}
}
},
trigger: 'click'
});
var endTime = laydate.render({
elem:'#CDSJ',
type:'date',
done:function(value,date){
if(value!==""){
startTime.config.max={
year:date.year,
month:date.month-1, //关键
date: date.date
};
}else {
startTime.config.max={