Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 11/29/2012
Components: Language
Versions: 10.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: Final /
Priority/Frequency: Trivial / Unknown
Locale/System: English / Platforms All
Vote Count: 1
It would be good if createDateTime() was "overloaded" with variations as follows:
justYearWasSet = createDateTime(2012); // all other components use either now() or 0/1 as most appropriate (probably the former)
monthWasSetToo = createDateTime(2012, 11);
dayWasSetToo = createDateTime(2012, 11, 29);
hourWasSetToo = createDateTime(2012, 11, 29, 15);
minWasSetToo = createDateTime(2012, 11, 29, 15, 7);
Better yet would be able to do this:
monthWasSet = createDateTime(month=11);
dayWasSet = createDateTime(day=29);
Often I have a date/time which is mostly correct, but I want to change just the month and the day, or the hour and the minute or something.
This can be worked-around with dateAdd(), but it's clumsy and masks the intent of the code. It'd be better to just be able to set the individual components.
Better still, would be able to do this:
myDate.setYear(2012) (with setMonth() setDay(), etc)
This would be at odds with the rest of CFML's function(object, args) approach, but perhaps it's time for CFML to move on from that (as a bigger body of work).
--
Adam
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3374275
External Customer Info:
External Company:
External Customer Name: Adam Cameron.
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: