Okay, this works great, however, now that I look at it I realize that I made this too simple (of course, right).
We are not open on Saturday and Sunday, so the days added need to be adjusted based on the day the item is ordered. I played with variations of the following code, but it still doesn't work correctly.
Basically...
All orders placed Thurs after 10 are due Mon at noon.
All orders placed Fri before 10 are due Mon at noon.
All orders placed Fri after 10 are due Tue at noon.
All orders placed Sat or Sun (at any time) are due Tue at noon.
All other days and times foilow the old formula
Here is my last attempt:
var myDate = new Date(); // current local date and time
myDate.setDate(myDate.getDate()+1); // add one day
var theDate=new Date(Today());
var weekday=new Array(7);
weekday[0]="4";
weekday[1]="0";
weekday[2]="0";
weekday[3]="0";
weekday[4]="1";
weekday[5]="2";
weekday[6]="3";
var newDay = weekday[theDate.getDay()];
if ((newDay=0) && (myDate.getHours() >= 10))
myDate.setDate(myDate.getDate()+1);
else if ((newDay=1) && (myDate.getHours() >= 10))
myDate.setDate(myDate.getDate()+4);
else if ((newDay=2) && (myDate.getHours() <= 10))
myDate.setDate(myDate.getDate()+3);
else if ((newDay=2) && (myDate.getHours() >= 10))
myDate.setDate(myDate.getDate()+4);
else if (newDay=3)
myDate.setDate(myDate.getDate()+3);
else if (newDay=4)
myDate.setDate(myDate.getDate()+2);
else
myDate.setDate(myDate.getDate());
myDate.setHours(12);
myDate.setMinutes(0);
myDate.setSeconds(0); // set to noon
return FormatDate (myDate,"mm/dd/yy - hh:nn")+" Noon";
Any ideas?