tracker issue : CF-3940802

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

Please make date member functions consistent.

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Adam Tuttle / Adam Tuttle (Adam Tuttle)

Created: 02/16/2015

Components: Language

Versions: 2018

Failure Type: Usability Issue

Found In Build/Fixed In Build: CF11_Final / 2018.0.0.306128

Priority/Frequency: Major / Most users will encounter

Locale/System: ALL / Platforms All

Vote Count: 9

The only date member functions that require the "date" prefix in the method name are: date.dateFormat(), date.timeFormat(), and date.dateTimeFormat()... All other date member functions have dropped the "date" prefix.

Compare this to arrays, where all member functions have dropped the "array" method name prefix.

I understand that this was probably a decision made to support all three functions... but think about it: Is that really necessary? dateTimeFormat does everything that dateFormat and timeFormat can do.

I propose a single date.format() method that implements the same masking as dateTimeFormat, and that you DROP support for date.dateFormat, date.timeFormat (and of course, date.dateTimeFormat).

Rip this band-aid off now before people's code becomes littered with it!

The only time I think method name type-prefixes are acceptable are in the case of list functions, because lists are not a type, they are just strings with implied context.

Indeed, excusing the list functions, this date/time/dateTimeFormat debacle is the ONLY (documented: https://wikidocs.adobe.com/wiki/display/coldfusionen/Using+the+member+functions) case where the "date" prefix was kept. Let's get rid of it now while we still can!

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3940802

External Customer Info:
External Company:  
External Customer Name: Adam
External Customer Email:  
External Test Config: N/A

Attachments:

Comments:

As Scott Stroz would say, "If only that meeting had lasted 5 more minutes..."
Comment by External U.
8445 | February 16, 2015 04:30:22 PM GMT
I'd not rip them out, but I'd definitely mark them as deprecated in the docs. The docs... oh, that's right... there aren't any for the method versions of the procedural functions. So here's an idea, Adobe: write your documentation, THEN mark the dateFormat(), timeFormat() and dateTimeFormat() methods as deprecated.
Comment by External U.
8446 | February 16, 2015 04:34:32 PM GMT
+1 (Vote must be between 25 and 4000 characters)
Vote by External U.
8450 | February 16, 2015 04:34:54 PM GMT
Agreed with Adam. Deprecate and plan for removal.
Vote by External U.
8451 | February 16, 2015 04:38:12 PM GMT
+1 (Vote must be between 25 and 4000 characters)
Vote by External U.
8452 | February 16, 2015 05:12:13 PM GMT
+1 Best to do this now. (Vote must be between 25 and 4000 characters)
Vote by External U.
8453 | February 16, 2015 11:52:44 PM GMT
+1 .
Vote by External U.
8454 | February 17, 2015 10:22:50 AM GMT
+1 .
Vote by External U.
8455 | February 17, 2015 12:13:45 PM GMT
+1 I'm all for simplification of the language.
Vote by External U.
8456 | February 23, 2015 12:20:02 PM GMT
Add format for datetimeFormat.
Comment by Awdhesh K.
8447 | August 18, 2015 07:48:04 AM GMT
+1. . . . . . . . . . . . . . . .
Vote by External U.
8457 | August 19, 2015 12:23:34 AM GMT
+1 ......................
Vote by External U.
8458 | September 28, 2015 01:05:43 AM GMT
We will evaluate this for the release after Raijin.
Comment by Vamseekrishna N.
8448 | December 07, 2015 09:50:38 PM GMT
Yet another instance of you lot ignoring your clients until the ship has sailed on the subsequent release of CF.
Comment by External U.
8449 | December 08, 2015 01:26:55 AM GMT
Hi Adobe, Since DateFormat()/TimeFormat()/DateTimeFormat() treat the short/medium/long/full masks differently, it necessitates an optional `formatter` parameter for specifying which mask. Example: <cfscript> myDateTime = createDate(2018,1,1) writeOutput(myDateTime.format("full"))//should return: Monday, January 1, 2018 12:00:00 AM GMT writeOutput(myDateTime.format("date", "full"))//should return: Monday, January 1, 2018 writeOutput(myDateTime.format("time", "full"))//should return: 12:00:00 AM GMT </cfscript> That's needed since this ticket calls for .format() as being a single replacement for all of DateFormat()/TimeFormat()/DateTimeFormat() functionality. Therefore, users should not have to revert to .dateFormat() for DateFormat()'s short/medium/long/full masks. And likewise for TimeFormat()'s. Anyone agree? Adobe? Thanks!, -Aaron
Comment by Aaron N.
27312 | April 06, 2018 10:06:23 PM GMT
Hi Adobe, Please disregard my previous comment. .dateFormat()/.timeFormat()/.dateTimeFormat() should also remain supported. Thanks!, -Aaron
Comment by Aaron N.
27313 | April 06, 2018 11:28:45 PM GMT