Status/Resolution/Reason: Closed/Fixed/HaveNewInfo
Reporter/Name(from Bugbase): Aaron Neff / ()
Created: 04/06/2018
Components: Documentation
Versions: 2016
Failure Type: Conflict With Docs
Found In Build/Fixed In Build: 0 / NA
Priority/Frequency: Normal / Few users will encounter
Locale/System: / Platforms All
Vote Count: 0
Issue: some DateFormat() masks are undocumented
Repro:
<cfscript>
myDateTime = createDateTime(2016,1,3,12,34,56);
commonMasks = ["d", "dd", "m", "mm", "mmm", "mmmm", "w", "W", "yy", "yyyy", "YYYY", "short", "medium", "long", "full"];//Documented in DateFormat() and DateTimeFormat() docs
dateFormatMasks = ["ddd", "dddd", "e", "E", "f", "F", "k", "K", "gg", "z", "Z", "X"];//Only documented in DateFormat() doc
dateTimeFormatMasks = ["EEE", "EEEE", "Y", "YY", "G", "ww", "WW"];//Only documented in DateTimeFormat() doc
simpleDateFormatMasks = ["M", "L", "D", "u", "a"];//Only documented in SimpleDateFormat doc
result = queryNew("pattern,isInDateFormatDoc,isInDateTimeFormatDoc,dateFormatOutput,dateTimeFormatOutput", "varchar,bit,bit,varchar,varchar");
commonMasks.each(function(element) {
result.addRow([element, true, true, myDateTime.dateFormat(element), myDateTime.dateTimeFormat(element)]);
});
dateFormatMasks.each(function(element) {
result.addRow([element, true, false, myDateTime.dateFormat(element), myDateTime.dateTimeFormat(element)]);
});
dateTimeFormatMasks.each(function(element) {
result.addRow([element, false, true, myDateTime.dateFormat(element), myDateTime.dateTimeFormat(element)]);
});
simpleDateFormatMasks.each(function(element) {
result.addRow([element, false, false, myDateTime.dateFormat(element), myDateTime.dateTimeFormat(element)]);
});
writeOutput(myDateTime);
writeDump(result);
</cfscript>
Actual result: masks "EEE, EEEE, Y, YY, G, ww, WW, M and D" are undocumented in the DateFormat() doc
Expected result: masks "EEE, EEEE, Y, YY, G, ww, WW, M and D" are documented in the DateFormat() doc
Notes:
1) "e/E" is documented on DateFormat() but "EEE and EEEE" are documented in DateTimeFormat(). Since "e/ee/eee" return the same, and "E/EE/EEE" return the same, I'd suggest these steps in sequence:
1a) In DateFormat(), remove the "e/E: Day in a week." bullet.
1b) In DateTimeFormat(), change "EEE" to "eee/EEE" and change "EEEE" to "eeee/EEEE".
1c) Copy the "eee/EEE" and "eeee/EEEE" bullets over to DateFormat() where "e/E" used to be.
2) Masks "Y and YY" currently don't work as documented on SimpleDateFormat, until CF-4103427 is fixed.
3) Masks "w and W" are currently wrong in the DateFormat() doc. The descriptions should be flipped, or copied from DateTimeFormat(). And, of course, the "ww and WW" masks should be copied from DateTimeFormat() to DateFormat(). And "w and W" also need corrected in DateFormat()'s History section.
4) Masks "M and D" are only documented in the SimpleDateFormat doc. They work, so they should be documented in the DateFormat() and DateTimeFormat() docs.
Related URL: https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/DateFormat.html
Attachments:
Comments: