I'm trying to output all dates from start to end date to array. Once I get all dates in array I have created a function that loop thorough array and add a className. Here is my code that creates array:
<cfoutput query="qryOne">
<cfloop from="#PickDateTime#" to="#DropDateTime#" index="i" step="#CreateTimeSpan(1,0,0,0)#">
dateArray[#currentrow#] = new Array("#UserID#","#dateformat(i,'mmddyyyy')#");
</cfloop>
</cfoutput>
and here is my JavaScript function:
var dateArray = new Array();
function getDate(){
for (var i=1; i < dateArray.length; i++){
result = document.getElementById(dateArray[i][1])
result.className = 'booked'
}
}
So problem that I have at this point is that code gives me just End dates. Sometimes I have start and end time that happen on the same date but also sometimes we can have date range. Here is few examples:
Start End
01/21/2015 01/21/2015
08:00 AM 12:30 PM
01/23/2015 01/24/2015
09:00 AM 03:00 PM
01/31/2015 02/05/2015
11:00 AM 10:00 AM
So my current code gives me just the end dates, I need to get all dates. If anyone see what I'm doing wrong in my code above please let me know. Thanks.