Posts: 17
Location: Kansas City area
|
I am trying to have a table project out 5 days. After the 7 day it displayes undetermined instead of the day. After Tuesday, it defaults on Sunday, on Wednesday it will default on Sat and Sun. Here is a copy of a script I used:
// -- made by A1javascripts.com, please keep these credits when using this script
days = new Array(7)
days[1] = "Sunday";
days[2] = "Monday";
days[3] = "Tuesday";
days[4] = "Wednesday";
days[5] = "Thursday";
days[6] = "Friday";
days[7] = "Saturday";
days[8] = "Sunday";
months = new Array(12)
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";
today = new Date(); day = days[today.getDay() + 6]
month = months[today.getMonth() + 1]
date = [today.getDate() + 5]
year=today.getYear();
if (year < 2000)
year = year + 1900;
document.write ("<font size=-2 face='Arial, Helvetica, sans-serif' color=003399> " + day +
", " + month + " " + date + ", " + year + "</font>")
// -- end hiding
</script></font> </td>
I modified it from it's original to project out date further than just today's. I added the days[8] = "Sunday" just so it will work from Tuesday. There has to be something like a if then statement used for basic in Java, so that when 7 is reached it goes back to 1. Any help?
|