let startDate = new Date();
startDate.setDate(endDate.getDate() - 2);
I want to substract 2 days from endDate, and get the new date. this code works fine if we stay in the same month after subtraction. how can I substract days and get the currect date, even if a month or a year changed?