function getDateArray (start, end) { var arr = []; var startDate = new Date(start); console.log(startDate); var endDate = new Date(end); console.log(endDate); var ddlPayType = document.getElementById("payType"); var selectedPayType = ddlPayType.options[ddlPayType.selectedIndex].value; var selectedFrequency; if (document.getElementById("ddFrequency")) selectedFrequency = document.getElementById("ddFrequency").value; if (selectedPayType) { if (selectedPayType === "A") { endDate.setMonth(endDate.getMonth()); } else if (selectedPayType === "B") { endDate.setMonth(endDate.getMonth() + 1); } } while (startDate <= endDate) { arr.push(new Date(startDate)); startDate.setDate(endDate.getDate()+1); startDate.setMonth(startDate.getMonth() +1); } return arr; }
while (startDate < endDate) { arr.push(new Date(startDate)); startDate.setDate(endDate.getDate() ); startDate.setMonth(startDate.getMonth() + 1); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)