获取当前日期及目标日期
var myDate =new Date();
myDate.getFullYear();
myDate.getMonth();
myDate.getDate();
this.nowDate = myDate.getFullYear() +'-' + (myDate.getMonth() +1) +'-' + myDate.getDate()
var timeStr1 =this.nowDate;
var timeStr2 = values.effectTime.format('YYYY-MM-DD');
var time1 =new Date(timeStr1).getTime();//当前日期
var time2 =new Date(timeStr2).getTime();//目标日期
主要是日期转化为时间戳再就行判断
//判断日期相差多少天
compare(start,end){
start =start.getTime();
end =end.getTime();
var time =0
time =end-start;
return Math.floor(time/86400000)
},