hi,
i have been given a function to add working days to a date. here it is:
[CODE]function addWorkingDays(myDate,days) { //myDate = starting
date, days = no. working days to add.
var temp_date = new Date();
var i = 0;
var days_to_add = 1;
while (i < (days)){
temp_date = new Date(myDate.getTime() +
(days_to_add*24*60*60*1000));
//0 = Sunday, 6 = Saturday, if the date not
equals a weekend day then increase by 1
if ((temp_date.getDay() != 0) &&
(temp_date.getDay() != 6)){
i+=1;
}
days_to_add += 1;
}
return new Date(myDate.getTime() +
days_to_add*24*60*60*1000);
}
i understand this has to go into the head section of my page but need a little help displaying it on my website. what i want it to do is add x number of days to todays date. im pretty sure it was designed to add working days to a user submitted day but it cant be that hard to have it calculate based on todays date. also is there a way of makeing it uk compatible eg swapping the day and month (dd/mm/yyy instead of mm/dd/yyy).
thanks very much in advance
chris