tracker issue : CF-4198286

select a category, or use search below
(searches all categories and all time range)

isDate returns true for numbers

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Tom Chiverton / Tom Chiverton ()

Created: 01/25/2017

Components: Core Runtime

Versions: 11.0

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: hf11 / 10,0,23,302309, 11,0,12,302325 , 2016.0.04.302324

Priority/Frequency: Normal / All users will encounter

Locale/System: / Linux All

Vote Count: 0

Problem Description:
isDate(17824761) returns true

Steps to Reproduce:

Actual Result:

Expected Result:

Any Workarounds:



isDate(174761) also returns true.
Comment by Tom C.
1294 | January 25, 2017 02:49:20 PM GMT
<cfoutput>#isDate(1782476117824761)#</cfoutput> is also true
Comment by Tom C.
1295 | January 25, 2017 02:50:32 PM GMT
I thing this is the Linux version of the Windows-only bug ?
Comment by Tom C.
1296 | January 25, 2017 02:57:02 PM GMT
I think the more important issue here is that the behavior has changed - we can argue all day about whether some number... or the result of 'getTickCount()' is actually a date (it is - just not in a format most of use can easily parse - so it all comes down to definitions). If isDate() was being introduced to CF, it would be reasonable to be discussing these things - however... this is an old method which has been used for years and has an expected behavior - any changes to this behavior can (and do) cause problems. It appears that the original implementation is intended to determine if a string is formatted in some sort of human-readable date format - simple integers clearly do not meet that test, and all other CF versions that I'm aware of appear to bear out my assumption about the intent.
Comment by Tim P.
1297 | January 25, 2017 03:33:11 PM GMT
Hot fix from resolves the issue
Comment by Tom C.
1298 | February 05, 2017 12:19:09 PM GMT