tracker issue : CF-4201890

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

[ANeff] ER for: simpleValue.date|time|dateTimeFormat()

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/AsDesigned

Reporter/Name(from Bugbase): Aaron Neff / ()

Created: 04/07/2018

Components: Language, Member Functions

Versions: 2016

Failure Type: Others

Found In Build/Fixed In Build: /

Priority/Frequency: Normal /

Locale/System: /

Vote Count: 0

Note: The language should be predictable. If someDataTypeBIF(myVariable) works, then myVariable.someDataTypeBIF() should also work.

This ER is for simpleValue.date|time|dateTimeFormat(), for simple values that can be treated as DateTime.

Repro:

<cfscript>
  simpleValues = [2000,2*1000,2000.0,"2000",createDate(2018,1,1)+1];
  simpleValues.each(function(element) {
    try {
      writeOutput(dateFormat(element) & ' | ' & timeFormat(element) & ' | ' & dateTimeFormat(element) & ' | ' & element.dateFormat() & ' | ' & element.timeFormat() & ' | ' & element.dateTimeFormat() & '<br>');
    }
    catch(any e) {
      writeOutput(dateFormat(element) & ' | ' & timeFormat(element) & ' | ' & dateTimeFormat(element) & ' | .date|time|dateTimeFormat() doesn''t exist<br>');
    }
  });
</cfscript>

Actual result:

22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00 | .date|time|dateTimeFormat() doesn't exist
22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00 | .date|time|dateTimeFormat() doesn't exist
22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00 | .date|time|dateTimeFormat() doesn't exist
22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00 | .date|time|dateTimeFormat() doesn't exist
02-Jan-18 | 12:00 AM | 02-Jan-2018 00:00:00 | .date|time|dateTimeFormat() doesn't exist

Expected result:

22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00 | 22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00
22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00 | 22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00
22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00 | 22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00
22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00 | 22-Jun-05 | 12:00 AM | 22-Jun-1905 00:00:00
02-Jan-18 | 12:00 AM | 02-Jan-2018 00:00:00 | 02-Jan-18 | 12:00 AM | 02-Jan-2018 00:00:00

Attachments:

Comments:

Member function route are different from BIFs .Member functions are type aware. With type preservation feature on the board in aether, the data type of variable will be preserved from compilation phase to the runtime. This will provide us performance incentive as we can avoid some unnecessary casts along the way. Member function will be linked based on the type of object on which it is invoked. The cfloop bug fix wherein we allowed date functions on numeric has been reverted. It will be available in GM. Whatever behavior that is mentioned in the bug is expected . Hence , Closing the bug!
Comment by Vijay M.
27508 | April 09, 2018 04:47:53 PM GMT