how to get a week start date from week number dynamically using moment js
I have the start date that can be a new date or future date and I have the week count dynamically, a form that dates I need to find the weeks start date. For example, if I have 21 days that means three weeks, I need to find each week start date. I tried with some bit of code.
weeklyFun = (value, date) => {
const totaldays = (value * 7);
const endDate = moment(date, "DD-MM-YYYY").add(totaldays, 'd').format("DD-MM-YYYY");
}
this.weeklyFun(3, '18-10-2019');
my expected output is for 21 days 18-10-2019, 25-10-2019, 01-11-2019