再次头痛一天。需要对某些内容进行一些更改并首先填充可用的内容。基本上从什么东西开放直到它关闭。并且每15分钟添加一次可用的点。
我可以填充开始日期和结束日期 - 但无法获得内部循环填充需要插入的增量时间...这里很少丢失...感谢任何帮助......
开始日期和结束日期来自cfform - 工作正常...
Start Date:<br>
<cfinput type="datefield" name="startDate" required="true" message="Start Date Required">
<br><br>
End Date:<br>
<cfinput type="datefield" name="EndDate" required="true" message="End Date Required">
<cfloop index="dtToday" from="#StartDate#" to="#EndDate#">
<cfoutput>
<br>#DateFormat(dttoday)#<br>
<cfloop index="incr" from="#TimeFormat(sadd.topen)#" to="#TimeFormat(sadd.tclose)#" step="#CreateTimeSpan( 0, 0, sadd.increment, 0 )#">
[#TimeFormat(incr)#]
Do Database Insert of Date/Time at increments
</cfloop>
<cfset schdate = #DateAdd('d', 1, '#schdate#')#>
</cfoutput>
</cfloop>
答案 0 :(得分:0)
我修改了你的代码,以便我可以快速测试它。 CF Live表明这可以在Railo和CF中使用。
我们不清楚您的问题来自何处,因为我没有对您的代码进行任何重大更改。
<!--- You can get rid of these two form declarations, and the sadd declaration. This was just mimicking your data. --->
<cfset form.startdate = "11/17/95">
<cfset form.enddate = "12/20/95">
<cfset sadd = {topen= "13:00", tclose= "17:00", increment = 15}>
<cfif isDate(form.startdate) and isDate(form.enddate)>
<cfloop index="dtToday" from="#form.StartDate#" to="#form.EndDate#">
<cfoutput>
<br>#DateFormat(dttoday)#<br>
<cfloop index="incr" from="#TimeFormat(sadd.topen)#" to="#TimeFormat(sadd.tclose)#" step="#CreateTimeSpan( 0, 0, sadd.increment, 0 )#">
[#TimeFormat(incr)#] - Do Database Insert of Date/Time at increments<br>
</cfloop>
<!---<cfset schdate = #DateAdd('d', 1, '#schdate#')#>--->
</cfoutput>
</cfloop>
<cfelse>
One or both of the dates entered is invalid.
</cfif>
我改变了: