Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Indy Griffiths / Indy Griffiths (Indy Griffiths)
Created: 06/17/2014
Components: Language
Versions: 11.0
Failure Type: Incorrect w/Workaround
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Normal / Some users will encounter
Locale/System: ALL / Windows 8.1/64bit
Vote Count: 0
Problem Description:
When using the CFLOOP tag in pre-CF10 code, it was possible to specify a from and to attribute that was a simple time value (e.g 08:00:00 or 19:00:00. However this seems to be broken in CF11 and is mainly a backwards compatibility issue.
Steps to Reproduce:
Simple loop that will output every time between 8am and 7:30pm in 5 minute increments. Works pre-CF11.
<cfloop from="08:00:00" to="19:30:00" index="time" step="#CreateTimeSpan(0,0,5,0)#">
#TimeFormat(time, "hh:mm:ss")#<br>
</cfloop>
Actual Result:
Attribute validation error for CFLOOP.
The value of the FROM attribute is invalid. The value cannot be converted to a numeric because it is not a simple value. Simple values are booleans, numbers, strings, and date-time values.
Expected Result:
08:00:00
08:05:00
08:10:00
and so on...
Any Workarounds:
Use the CreateTime function.
<cfloop from="#CreateTime(8,0,0)#" to="#CreateTime(19,30,0)#" index="time" step="#CreateTimeSpan(0,0,5,0)#">
#TimeFormat(time, "hh:mm:ss")#<br>
</cfloop>
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3777403
External Customer Info:
External Company:
External Customer Name: indy-griffiths
External Customer Email:
External Test Config: My Hardware and Environment details:
ColdFusion 11 Standard
Windows 8.1
16GB RAM
Attachments:
Comments: