our server admin upgraded to lucee 6 today and now...
# lucee
b
our server admin upgraded to lucee 6 today and now this no longer works:
Copy code
<cfset fromDate = "01/01/2024"> 
<cfset toDate = "01/10/2024"> 
<cfloop from="#fromDate#" to="#toDate#" index="i" step="#CreateTimeSpan(1,0,0,0)#"> 
    <cfoutput>#dateformat(i, "mm/dd/yyyy")#<br></cfoutput> 
</cfloop>
says
cannot cast [01/01/2024] string to a number value
any tips on how to fix this?
s
does
parseDateTime( fromDate )
and
parseDateTime( toDate )
work in that cfloop?
👍 1
r
It works on the beta version of Lucee 6 on trycf.com.
b
thanks sam... that did the trick
s
that seems 'correct' even if Lucee can handle the string, just because I'd be worried about date formatting causing it to try and parse something as a number, vs. getting a bonafide datetime obj
✅ 1
r
Yeah, I was going to recommend using createDate() or parseDateTime() myself. I avoid string representations of dates as much as possible.
a
^^^ all of this. Obvs this is just an example for the repro case, but... using strings-that-look-like-dates instead of using actual dates is "less good than it could be" (shall I say) in the application design dept. That aside, it should work, and that it doesn't looks like a bug in Lucee that ought to be reported. What exact Lucee version are you on?
b
@Adam Cameron i tried several different version of 6.0 server start cfengine=lucee@6.0.1-SNAPSHOT+52 server start cfengine=lucee@6.0.0-RC+585 server start cfengine=lucee@6.0.0-RC+481 all of these had this behavior. but the parsedatetime() resolved it.
a
I'm not really that concerned about your immediate issue (given it's solved 'n'all). I'm concerned about how it's gonna bite other ppl if it's not fixed. What are the acrtual lucee versions on those? ie: server.lucee.version Also: pretty sure your admin person didn't upgrade Lucee to something with "RC" or "SNAPSHOT" in the version did they? Please say they didn't... 😕
b
they didn't.. but those are the versions i tested on. he was on 6.0.1 from the website. not sure the build or anything
a
OK, so 6.0,1 isn't released yet (as far as I can tell from this lot: https://download.lucee.org/). 6.0.0.585 seems to be where they're at. Urgh. And I'm on Docker and there's no 6.x image on Docker Hub yet 😕 ...aah but I seem to be able to upgrade from my 5.4 container to 6.0 via Lucee Admin... lemme give that a go...
Yeah I can repro on 6.0.0.585. Cool.
And 6.0.1.52-SNAPSHOT
First broke in 6.0.0.449-SNAPSHOT.
b
i was going to try and see where it broke but got sidelined with meetings. thanks for tracking that down
a
This is the only ticket with a "fixversion" of `6.0.0.449`: https://luceeserver.atlassian.net/browse/LDEV-4506 And it's to do with dates...
b
thanks!
a
NP. I was in a better position to narrow down when it went wrong than you were I think (for one thing you perhaps have better things to do. Me? Not so much this evening 😛 )
😂 1
b
i appreciate it