class Holidays

This class provides static functions about holidays and working days

Methods

static int
workdays(DateTime $startDate, DateTime $endDate)

Returns the number of working days between two dates

static DateTime
nextWorkingDay(DateTime $date)

Returns the working day following the given date

static array
fixedHolidays(int $year, string $lang = "en-US")

Returns the list of fixed holidays of the given year for the given lang and country

static array
moveableHolidays(int $year, string $lang = "en-US")

Returns the list of moveable holidays of the given year for the given lang and country

static array
holidays(int $year, string $lang = "en.US")

Returns the list of holidays of the given year for the given lang and country

static DateTime
easter(int $year)

Returns the easter day of the given year

static bool
isWorkingDay(DateTime $date)

Determines whether the given date is a working day

Details

at line 48
static int workdays(DateTime $startDate, DateTime $endDate)

Returns the number of working days between two dates

Parameters

DateTime $startDate The starting date
DateTime $endDate The end date

Return Value

int The number of working days

at line 100
static DateTime nextWorkingDay(DateTime $date)

Returns the working day following the given date

Parameters

DateTime $date The given date

Return Value

DateTime The next working day

at line 118
static private array fixedHolidays(int $year, string $lang = "en-US")

Returns the list of fixed holidays of the given year for the given lang and country

Parameters

int $year The given year
string $lang (default: "en.US") The given lang and country

Return Value

array The list of fixed holidays

at line 149
static private array moveableHolidays(int $year, string $lang = "en-US")

Returns the list of moveable holidays of the given year for the given lang and country

Parameters

int $year The given year
string $lang (default: "en.US") The given lang and country

Return Value

array The list of moveable holidays

at line 177
static private array holidays(int $year, string $lang = "en.US")

Returns the list of holidays of the given year for the given lang and country

Parameters

int $year The given year
string $lang (default: "en.US") The given lang and country

Return Value

array The list of holidays

at line 195
static private DateTime easter(int $year)

Returns the easter day of the given year

Parameters

int $year The given year

Return Value

DateTime The easter day

at line 213
static private bool isWorkingDay(DateTime $date)

Determines whether the given date is a working day

Parameters

DateTime $date The given date

Return Value

bool true if the dat is a working day, false otherwise