我将如何跳过 ColdFusion 中的特定时间段

How would I skip the specific time slot in ColdFusion

我正在为带教练的汽车创建一个预订系统,它基本上可以正常工作。我想实施我可以说想要阻止一些额外会话的规则。

例如,讲师刚从 6:00Am 结束课程到早上 8 点。如果他们决定背靠背安排和 8:15AM(如果他们想休息),下一个可用时段应该是上午 8 点。应隐藏其他 105 分钟跨度的会话,以便下一个可用会话将在上午 10 点

<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>

我发现我只是创建了 2 个数组,第一个用于可用的时间段,第二个用于已经占用的时间段,并删除我不需要的那个