Title:
DateDiff with a datepart of "w" (Weekdays) gives the number of weeks between two dates instead of Weekdays
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/BugVerified
Reporter/Name(from Bugbase): Dan Murphy / Dan Murphy (Dan Murphy)
Created: 06/13/2016
Components: Language
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final / 299753,299879,299880,300319
Priority/Frequency: Major / All users will encounter
Locale/System: English / Mac 10 All
Vote Count: 1
Problem Description:
When using the DateDiff function with a datepart of "w" (Weekdays), you get the number of weeks between the two dates instead of Weekdays between the two dates. This is exactly the same as using a date part of "ww" (Weeks). The docs are weird because they say "w: Weekdays (same as ww)". My guess is this was originally a bug and then the docs were just updated to reflect the bug instead of just fixing it or something.
Steps to Reproduce:
<cfscript>
weeks = dateDiff("w","2016-06-11","2016-06-21");
WriteDump(weeks);
</cfscript>
Actual Result:
1
Expected Result:
7
Any Workarounds:
Build your own Weekdays function
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4163932
External Customer Info:
External Company:
External Customer Name: Dan Murphy
External Customer Email:
External Test Config: My Hardware and Environment details:
Any and all will find the bug
Attachments:
Comments: