skipping sunday in working day in js
Hi friends I like to share some code to validate the date in number of days along with skipping sunday to validate working day in week. <span id="result"></span> var day= 14; document.getElementById('result').innerHTML = addDays(day); function addDays(day){ var day = parseInt(day); var weekday = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; for(var i=0;i<=day;i++){ var dates = new Date(); dates.setDate(dates.getDate() + i); //console.log(weekday[dates.getDay()]); if(weekday[dates.getDay()]=='Sunday'){ console.log('first if'); ...