Calculate Number of days between two dates excluding sundays and an array of holidays in Javascript -


how calculate business days between 2 dates in javascript.

say

date 1 : 04-25-2013 date 2 : 05-10-2013  holidays : ["04-27-2013","05-03-2013"] 

i want total number of days excluding holidays if exists between these 2 dates , excluding sundays if any.

i have tried can't able holidays array.

diff=enddate-startdate; var holidays=new array("04-28-2013","05-22-2013","06-28-2013"); idx_holidays=0; num_holidays=0; while(idx_holidays < holidays.length)    {        holiday=new date(holidays[idx_holidays]);        if(diff>holiday-startdate)            num_holidays++;        idx_holidays++;    } 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -