I am looking to add some days to a date returned by a jQuery datepicker field and then put it in an easy to read date format.
I have this code:
var end = $("#to-date").datepicker("getDate");
Returns:
Tue May 12 2020 00:00:00 GMT+0100 (British Summer Time)
I want to add 3 days to that date and then get that date returned in another date format.
I add the extra days:
console.log( end.getDate() + 3 );
Returns:
15
(3 days from the 12th)
I was expecting this to be
Fri May 15 2020 00:00:00 GMT+0100 (British Summer Time)
The end result I am looking for is to get the date in a dd/mm/yy
format after adding days to an existing date.
Is this possible with getDate()
?