I've not been able to find a solution for a specific date format I want such as Sunday, 31 Oct, 2019. I also require an offset value for the date.
The closest I could get was Sun 31 Oct 2019. I need to be able to offset the date with a number entered by a user. With the script I have below, on certain dates, the day/name returns "undefined" although the other date items return as correct.
Date.prototype.addDays = function(days) {
var date = new Date(this.valueOf());
date.setDate(date.getDate() + days);
return date;}
date = new Date();
offset = effect("Slider Control")("Slider");
dayOffset = offset%7;
myDate = (date.addDays(offset));
dateString = String(myDate);
myMonth = dateString.split(/\s+/).slice(1,3).join(' ');
d = new Date();
days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
myDay = days[d.getDay()+dayOffset];
myDay + ", " + myMonth
What am I missing? Could you please advise me?