The function should take a start date and an end date in the format DD/MM/YYYY as parameters. It has to return the number of work days between those two dates, keeping in mind that weekends are not work days. The following are also not work days: 1/1, 7/4, Thanksgiving and the day after Thanksgiving, and Christmas. The holidays that are not fixed dates makes this especially difficult for me. I would be most grateful if someone could provide me with such a function. Thanks!
<script>
function workDays(){
var Holidays =new Array("1/1/0000","7/4/0000
var holDates= new Array
for (i=1;i<Holidays.length;i++
{holDates[i]=new Date(Holidays[i])}
start=new Date(f1.start.value)
finish=new Date(f1.finish.value)
start.setHours(3)
finish.setHours(3)
f1.res.value=start
dayCount=0
while (start.getTime() <= finish.getTime())
{
if (( start.getDay()!=6) && (start.getDay()!=5 ) )
{holFlag=false
for (i=1;i<Holidays.length;i++
{if ((start.getDay()==holDates
if (!holFlag)dayCount+=1
}
start.setTime(start.getTim
}
return (dayCount)
}
</script>
<form name="f1">
<p>start<input type="text" name="start" size="20"><br>
finish<input type="text" name="finish" size="20"><br>
result<input type="text" name="res" size="20"> <input type="button" value="calculate"
onclick="res.value=workDay
</p>
</form>