WorkDay
in package
uses
ArrayEnabled
Table of Contents
Properties
Methods
- date() : array<string|int, mixed>|DateTime|float|int|string
- WORKDAY.
- evaluateArrayArguments() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.
- evaluateArrayArgumentsIgnore() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.
- evaluateArrayArgumentsSubset() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.
- evaluateArrayArgumentsSubsetFrom() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.
- evaluateSingleArgumentArray() : array<string|int, mixed>
- Handles array argument processing when the function accepts a single argument that can be an array argument.
- decrementing() : float|int|DateTime
- Use decrementing logic to determine Workday.
- decrementingArray() : float
- getWeekDay() : int
- incrementing() : float|int|DateTime
- Use incrementing logic to determine Workday.
- incrementingArray() : float
- initialiseHelper() : void
- testFalse() : bool
Properties
$arrayArgumentHelper
private
static ArrayArgumentHelper
$arrayArgumentHelper
$initializationNeeded
private
static bool
$initializationNeeded
= true
Methods
date()
WORKDAY.
public
static date(array<string|int, mixed>|mixed $startDate, array<string|int, mixed>|int $endDays, null|mixed ...$dateArgs) : array<string|int, mixed>|DateTime|float|int|string
Returns the date that is the indicated number of working days before or after a date (the starting date). Working days exclude weekends and any dates identified as holidays. Use WORKDAY to exclude weekends or holidays when you calculate invoice due dates, expected delivery times, or the number of days of work performed.
Excel Function: WORKDAY(startDate,endDays[,holidays[,holiday[,...]]])
Parameters
- $startDate : array<string|int, mixed>|mixed
-
Excel date serial value (float), PHP date timestamp (integer), PHP DateTime object, or a standard date string Or can be an array of date values
- $endDays : array<string|int, mixed>|int
-
The number of nonweekend and nonholiday days before or after startDate. A positive value for days yields a future date; a negative value yields a past date. Or can be an array of int values
- $dateArgs : null|mixed
-
An array of dates (such as holidays) to exclude from the calculation
Return values
array<string|int, mixed>|DateTime|float|int|string —Excel date/time serial value, PHP date/time serial value or PHP date/time object, depending on the value of the ReturnDateType flag If an array of values is passed for the $startDate or $endDays,arguments, then the returned result will also be an array with matching dimensions
evaluateArrayArguments()
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.
protected
static evaluateArrayArguments(callable $method, mixed ...$arguments) : array<string|int, mixed>
Example use for: ROUND() or DATE().
Parameters
- $method : callable
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsIgnore()
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.
protected
static evaluateArrayArgumentsIgnore(callable $method, int $ignore, mixed ...$arguments) : array<string|int, mixed>
Example use for: HLOOKUP() and VLOOKUP(), where argument 1 is a matrix that needs to be treated as a database rather than as an array argument.
Parameters
- $method : callable
- $ignore : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsSubset()
Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.
protected
static evaluateArrayArgumentsSubset(callable $method, int $limit, mixed ...$arguments) : array<string|int, mixed>
Example use for: NETWORKDAYS() or CONCATENATE(), where the last argument is a matrix (or a series of values) that need to be treated as a such rather than as an array arguments.
Parameters
- $method : callable
- $limit : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsSubsetFrom()
Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.
protected
static evaluateArrayArgumentsSubsetFrom(callable $method, int $start, mixed ...$arguments) : array<string|int, mixed>
Example use for: Z.TEST() or INDEX(), where the first argument 1 is a matrix that needs to be treated as a dataset rather than as an array argument.
Parameters
- $method : callable
- $start : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateSingleArgumentArray()
Handles array argument processing when the function accepts a single argument that can be an array argument.
protected
static evaluateSingleArgumentArray(callable $method, array<string|int, mixed> $values) : array<string|int, mixed>
Example use for: DAYOFMONTH() or FACT().
Parameters
- $method : callable
- $values : array<string|int, mixed>
Return values
array<string|int, mixed>decrementing()
Use decrementing logic to determine Workday.
private
static decrementing(float $startDate, int $endDays, array<string|int, mixed> $holidayArray) : float|int|DateTime
Parameters
- $startDate : float
- $endDays : int
- $holidayArray : array<string|int, mixed>
Return values
float|int|DateTimedecrementingArray()
private
static decrementingArray(float $startDate, float $endDate, array<string|int, mixed> $holidayArray) : float
Parameters
- $startDate : float
- $endDate : float
- $holidayArray : array<string|int, mixed>
Return values
floatgetWeekDay()
private
static getWeekDay(float $date, int $wd) : int
Parameters
- $date : float
- $wd : int
Return values
intincrementing()
Use incrementing logic to determine Workday.
private
static incrementing(float $startDate, int $endDays, array<string|int, mixed> $holidayArray) : float|int|DateTime
Parameters
- $startDate : float
- $endDays : int
- $holidayArray : array<string|int, mixed>
Return values
float|int|DateTimeincrementingArray()
private
static incrementingArray(float $startDate, float $endDate, array<string|int, mixed> $holidayArray) : float
Parameters
- $startDate : float
- $endDate : float
- $holidayArray : array<string|int, mixed>
Return values
floatinitialiseHelper()
private
static initialiseHelper(array<string|int, mixed>|false $arguments) : void
Parameters
- $arguments : array<string|int, mixed>|false
-
Can be changed to array for Php8.1+
testFalse()
private
static testFalse(mixed $value) : bool
Parameters
- $value : mixed