## Count days

&nbsp;<BR>How can I calculate the number of days in a two set of given date range (ex: <BR>starts date to end Date)? <BR>- Need to subtract the weekend <BR>- Need to subtract this holidays <BR>thanks giving Christmas (Dec 25), <BR>boxing day(Dec 26),new year(Jan 1) good Friday <BR><BR> <BR><BR><BR><BR>If (typeLeave ==”V”){<BR>var i=0;<BR>//reading from the check box and split the date and name<BR>var e = new Enumerator (Request.QueryString("holiday"));<BR><BR> while ( !e.atEnd ( ) ) { <BR> var holiday = e.item () <BR> var name = new String (holiday);<BR> var tempHol = new Array();<BR> tempHol = name.split("-");<BR> var holidayName = tempHol[0];<BR> var holidayDate = tempHol[1];<BR> arrayDate = new Array(holidayDate);<BR><BR> i=i+1;<BR> e.moveNext ( );<BR> <BR><BR> } <BR><BR>But the holiday’s date is read from the check box (arrayDate) but need to compare between the date range entered<BR><BR><BR>I will need to do a comparison based on what holiday is in the arrayDate From this, I will need to do a How many days My problems are - How do I do the comparison, and how do I come up with the function to counts Days <BR><BR><BR>// get the milliseconds for this Date object. <BR>var bufferA = Date.parse (aLeaveStart);<BR>var bufferB = Date.parse (aLeaveEnd);<BR><BR><BR>var number = (bufferB+86400000) - bufferA;<BR> iOut = parseInt(number/86400000);<BR><BR> var dtTemp;<BR><BR>var i=0,k=0,d = 0,j=0;ju=0;<BR> <BR>while(i&#060;iOut){<BR>num = i*86400000;<BR>var nDays;<BR>var tot = (bufferA+num);<BR>dtTemp = new Date( tot )<BR><BR>var holMonth = dtTemp.getMonth();<BR>var holDate = dtTemp.getDate();<BR>var lngWeekDay = dtTemp.getDay();<BR><BR>// to deduct the week end from the request range date<BR>if ((lngWeekDay == 6) &#124&#124 (lngWeekDay == 0)){ <BR> k=k+1;<BR> }<BR><BR>but <BR>Please help me <BR><BR><BR>