IsWeekday([Date])
Last updated August 17, 2001
Version: 1 | Requires: CF5 | Library: DateLib
Description:
Returns true if a date is during the week. This is defined as any day between Monday and Friday. The function defaults to today.
Return Values:
Returns a boolean.
Example:
<CFOUTPUT>
Is it a week day? #IsWeekday()#
</CFOUTPUT>
Parameters:
Name | Description | Required |
---|---|---|
Date | Defaults to today. | No |
Full UDF Source:
/**
* Returns true if a date is during the week.
*
* @param Date Defaults to today.
* @return Returns a boolean.
* @author Raymond Camden (ray@camdenfamily.com)
* @version 1, August 17, 2001
*/
function IsWeekDay() {
var today = Now();
if(ArrayLen(Arguments)) today = Arguments[1];
return (DayOfWeek(today) GTE 2 AND DayOfWeek(today) LTE 6);
}
Search CFLib.org
Latest Additions
Raymond Camden added
QueryDeleteRows
November 04, 2017
Leigh added
nullPad
May 11, 2016
Raymond Camden added
stripHTML
May 10, 2016
Kevin Cotton added
date2ExcelDate
May 05, 2016
Raymond Camden added
CapFirst
April 25, 2016