js判断日期是否是近三天
getDayName (d) {
var td = new Date();
td = new Date(td.getFullYear(), td.getMonth(), td.getDate());
var od = new Date(d);
od = new Date(od.getFullYear(), od.getMonth(), od.getDate());
var xc = (od - td) / 1000 / 60 / 60 / 24;
if (xc < -2) {
return false
} else if (xc < -1) {
return true
} else if (xc < 0) {
return true
} else if (xc == 0) {
return true
} else if (xc < 2) {
return false
} else if (xc < 3) {
return false
} else {
return false;
}
},