## Number of days

To calculate the number of days in a two set of given date range (ex: 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>If (typeLeave ==”Vavation”){ <BR>var i=0; <BR>//reading from the check box and split the holiday date and holiday 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>the holiday’s date is read from the check box (arrayDate) but need to <BR>compare between the date range entered check it is fall into week end or <BR>sifferent day and subract from the total day <BR><BR><BR>I will need to do a comparison based on what holiday is in the arrayDate <BR>From this, I will need to do a How many days My problems are - How do I do <BR>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 Úte.parse (aLeaveEnd); <BR><BR><BR>var number = (bufferB+86400000) - bufferA; <BR> iOut = parseInt(number/86400000); <BR><BR>var dtTemp; <BR><BR>var i=0,k0,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>Please help me <BR>