上图为效果
1.最近7天
getSevenDays() {
const currentDate = new Date();
let startDate = new Date().setDate(currentDate.getDate() - 7);
startDate = new Date(startDate);
const endDate = new Date();
return [startDate, endDate];
}
2.最近14天
getForDays() {
const currentDate = new Date();
let startDate = new Date().setDate(currentDate.getDate() - 14);
startDate = new Date(startDate);
const endDate = new Date();
return [startDate, endDate];
}
3.最近一个月
getTdDays() {
const currentDate = new Date