I have a diferent number of days example (1=monday,2=tuesday.......) and i need to return the date o this day in the current week
For example: if i send number 3 to my function, in this current week, today is sunday 23 , and i need that my function give me the date of the day 3 in this week, in this case the wednesday day was june-19 . other example i pass the number 5 to my function the function return me the date of the day 5 this week (friday)= june-21 (2019/06/21)
something like that
let currentDate = new Date().toISOString().slice(0, 10)
d.setDate(d.getDate() - d.getDay() + n)where d is the current date and n is the day number you seek.