function getDate() {
const date = new Date();
const day = date.getDate();
const currentDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + day;
const agoDate = new Date();
agoDate.setDate(day - 90);
const threeMonthsAgoDate = agoDate.getFullYear() + "-" + (agoDate.getMonth() + 1) + "-" + agoDate.getDate();
return [threeMonthsAgoDate, currentDate];
}
eg.
currentDate = "2024-1-3"
threeMonthsAgoDate = "2023-10-5"