//获取AddDayCount天后的日期getDateBefore(AddDayCount) { var dd = new Date(); dd.setDate(dd.getDate() - AddDayCount);//获取AddDayCount天后的日期 var y = dd.getFullYear(); var m = dd.getMonth() < 10 ? '0' + dd.getMonth() : dd.getMonth();//获取当前月份的日期,不足10补0 var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate(); //获取当前几号,不足10补0 var hour = dd.getHours(); var min = dd.getMinutes(); var sec = dd.getSeconds(); return { year: y, month: m, day: d, hour: hour, min: min, sec: sec };},//设置开始和结束日期或时间beginTime: new Date(utils.getDateBefore(3).year, utils.getDateBefore(3).month, utils.getDateBefore(3).day, 0, 0, 0),endTime: new Date(utils.getDateBefore(-1).year, utils.getDateBefore(-1).month, utils.getDateBefore(-1).day, 0, 0, 0),复制代码