I am getting a date formatted this way:
18th February
And after adding weeks, should come back in the same format example:
input => 18th February + 7 weeks:
output => 31st March
I am able to get the date and add weeks but I am finding very complicate to format the date back.
This is what I have right now:
let date = new Date(("18th February").replace(/st|rd|nd|th/g, ""))
let weeks = 7 * 7
let newDate = date.setDate(date.getDate() + weeks)
console.log(new Date(newDate))
//Output
2001-03-31T23:00:00.000Z
//Desire Output
//31st March
Thank you for you help.