As long as you're using the JavaScript Date object, you might as well take advantage of all of the functions for it like this:
<<nobr>>
<<set $CurDate = new Date('June 14, 2018 15:30')>>
Current date: <<print getDayName($CurDate)>>, $CurDate<br>
<<set $Appointment = clone($CurDate)>>
<<set $Appointment.setDate($Appointment.getDate() + 1)>>
<<set $Appointment.setHours(18)>>
<<set $Appointment.setMinutes(0)>>
<<set $Appointment.setSeconds(0)>>
Appointment date: <<print getDayName($Appointment)>>, $Appointment<br>
<</nobr>>
NOTE: It's very important that you use the clone() function to copy the date object, or any objects, otherwise changing one object will also change the other for any code that's used in the same passage. (After going to a new passage in the story the objects are all basically cloned into separate variables.) This is because objects are normally copied by reference, instead of by value the way numbers, booleans, or strings are.
You'll need to add this function to your JavaScript section if you want to show the name of the day of the week as I did in the above code:
window.getDayName = function(CurDate) {
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][CurDate.getDay()];
};
Hope that helps!