The picture above shows the effect
1. Last 7 days
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. Last 14 days
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.Last month
getTdDays() {
const currentDate = new Date