@Watch('queryParam2.startTime')
changeStartTime(val) {
// console.log('start',val);
if(val!== "" && this.queryParam2.endTime !== "") {
if(new Date(val).getTime() > new Date(this.queryParam2.endTime).getTime()) {
this.isDisabled = true
bootbox.alert("操作起始时间不能晚于操作结束时间!")
$("#feedetail_startTime").datetimepicker('hide')
} else {
this.isDisabled = false
}
} else {
this.isDisabled = false
}
}
@Watch('queryParam2.endTime')
changeEndTime(val) {
// console.log('end',val);
if(val!== "" && this.queryParam2.startTime !== "") {
if(new Date(val).getTime() < new Date(this.queryParam2.startTime).getTime()) {
this.isDisabled = true
bootbox.alert("操作起始时间不能晚于操作结束时间!")
$("#feedetail_endTime").datetimepicker('hide')
} else {
this.isDisabled = false
}
} else {
this.isDisabled = false
}
}
标签:判断,false,val,getTime,isDisabled,起始,时间,startTime,queryParam2
From: https://blog.51cto.com/u_16171738/7066399