i have a problem where the user selects a range of dates. i need to then find out what dates fall between those two selected dates. they\'re coming in via jquery with someth
//start of with getting the dates from your array
var between =[]
for (var i = 0; i < arrayOfHolsInfoTbl.length; i++){
alert( holsInfoTblData[i].StartDate)
alert(holsInfoTblData[i].EndStart)
var datePickedStr1 = holsInfoTblData[i].StartDate;
var datePickedDate1 = new Date(datePickedStr1)//converts string to date object
var datePickedStr2 = holsInfoTblData[i].EndStart;
var datePickedDate2 = new Date(datePickedStr1)
while (datePickedDate1 <= datePickedDate2) {
between.push(new Date(datePickedDate1));
datePickedDate1.setDate(datePickedDate1.getDate() + 1);
}
}
//loop through array and print all dates that have been added to array
for (var j = 0; j < between.length; j++) {
alert("This is all the dates " + between[j])
}