I am creating a reservation system for the cars with instructors and its basically working correctly. I want to implement the rule where I can say want to block some additional sessions.
For example the instructor just finish session from 6:00Am to 8AM. the next available slot should be 8AM if they decide back to back scheduling and 8:15AM (if they want a break). The other sessions withing 105 minutes span should be hidden so the next available session will at either 10AM
<cfloop index="ii" from="#startHour#" to="#endHour#">
<cfloop index="jj" from="0" to="#60-locbtwMinute#" step="#locbtwMinute#">
<cfset showtime="y">
<cfset time = createtime(ii, jj, 0)>
<cfloop query="qAssignedSessions">
<cfset preSessionStart = dateadd("n",-locBtwSpan-buffertime,sessionstart)>
<cfset postSessionend = dateadd("n",bufferTime,sessionend)>
<cfif (hour(time) gt hour(preSessionStart) or (hour(time) eq hour(preSessionStart) and minute(time) gt minute(preSessionStart)))
and (hour(time) lt hour(postSessionend) or (hour(time) eq hour(postSessionend) and minute(time) lt minute(postSessionend)))>
<cfset showtime="n">
</cfif>
</cfloop>
<cfif ((datecompare(arguments.startDt,latestSessionDate) eq 1 and ((hour(time) eq 20 and minute(time) eq 00) or hour(time) lt 20))
or (datecompare(arguments.startDt,latestSessionDate) eq 0 and ((hour(time) eq 20 and minute(time) eq 00) or (hour(time) lt 20 and hour(time) gt hour(now()))))
)
and showtime eq "y">
<option value="<cfoutput>#timeformat(time, 'HH:mm')#</cfoutput>"><cfoutput>#timeformat(time, "hh:mm tt")#</cfoutput></option>
</cfif>
</cfloop>
</cfloop>
I figure out I just create 2 array one for time slots that are available and second for the one that are already taken and eliminate the one I do not need