The following code would generate time slots of a day with an interval of 5
minutes.
To be displayed with Greek system of AM and PM, however, for start and stop
validation sake, I'll keep 24 hour system for data value input, the tiny bug is
the 05 value, e.g. supposedly it is 1:05 but currently it is 1:5, hence, a
start of 1:15 and a stop of 1:05 should fail validation but since currently
1:05 is misrepresented with 1:5, the validation breaks. Thought, dealt with it
before but don't remember. Thanks.
<cfset H = "0">
<cfset m = "00">
<cfset interval = 0>
<cfset pmH = 0>
<cfselect name="stop">
<cfloop index=i from=-30 to=1400 step=5>
<cfoutput>
<cfset m= m + "05">
<!---
<cfif ListLast(m,":") IS "5">
<cfset m = '#Replace(m,"5","05")#'>
</cfif>
--->
<!-- get h -->
<cfif i mod 12 is 1>
<cfset H = H + 01>
<cfset m= "00">
<cfset interval = interval + 1>
<cfif H gt 12>
<cfset pmH = pmH + 1>
</cfif>
</cfif>
<option value="#H#:#m#"><cfif H lt 13>#H#<cfelse>#pmH#</cfif>:#m# <cfif
H lt 12> AM<cfelse> PM</cfif>
</cfoutput>
</cfloop>
</cfselect>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316951
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4