Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401]

(no description)

File Size: 201 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WorkDay:: (6 methods):
  date()
  incrementing()
  incrementingArray()
  decrementing()
  decrementingArray()
  getWeekDay()


Class: WorkDay  - X-Ref

date($startDate, $endDays, ...$dateArgs)   X-Ref
WORKDAY.

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[,...]]])

param: array|mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
param: array|int $endDays The number of nonweekend and nonholiday days before or after
param: null|mixed $dateArgs An array of dates (such as holidays) to exclude from the calculation
return: array|mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,

incrementing(float $startDate, int $endDays, array $holidayArray)   X-Ref
Use incrementing logic to determine Workday.

return: mixed

incrementingArray(float $startDate, float $endDate, array $holidayArray)   X-Ref
No description

decrementing(float $startDate, int $endDays, array $holidayArray)   X-Ref
Use decrementing logic to determine Workday.

return: mixed

decrementingArray(float $startDate, float $endDate, array $holidayArray)   X-Ref
No description

getWeekDay(float $date, int $wd)   X-Ref
No description