working with dates in react
How can i subtract 7 days from current date?
Date.setDatesetDate(lastWeekDate.getDate() - 7)Array.filterisWithinIntervalsubDays const currentDate = new Date();
const lastWeekDate = new Date(currentDate - 7);let date = new Date();
date.setDate(date.getDate() - 7);const currentDate = new Date();
let lastWeekDate = new Date();
lastWeekDate.setDate(lastWeekDate.getDate() - 7);const lastWeekDate = new Date(Date.now() - (1000 * 60 * 60 * 24 * 7));const filtered = issues.filter(issue => isWithinInterval(new Date(issue.created_at), { start: subDays(new Date(), 7), end: new Date()}));