js 获取某个日期与当前日期相差天数
// A code block
var currentDate = new Date(); //当前日期
var endDate = _this.endDate ;//要比较的目标日期
var dateStart = new Date(currentDate);
var dateEnd = new Date(endDate);
//difValue 就是相差天数 如果目标日期小于当前日期,则difValue 为负数
var difValue = (dateEnd - dateStart) / (1000 * 60 * 60 * 24);
console.log(difValue)