PHPackages                             treehousetim/bank-holidays - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. treehousetim/bank-holidays

ActiveLibrary

treehousetim/bank-holidays
==========================

A simple, zero-dependency, bank holiday calculator for PHP.

1.0.4(1y ago)0928↓50%MITPHPPHP &gt;=7.0

Since Jan 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/treehousetim/bankHolidays)[ Packagist](https://packagist.org/packages/treehousetim/bank-holidays)[ RSS](/packages/treehousetim-bank-holidays/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (1)Versions (10)Used By (0)

bankHolidays
============

[](#bankholidays)

[![Unit Tests](https://github.com/treehousetim/bankHolidays/workflows/Unit%20Tests/badge.svg)](https://github.com/treehousetim/bankHolidays/workflows/Unit%20Tests/badge.svg)

Current Version
---------------

[](#current-version)

1.0.4

Bank Holiday Date calculations in PHP for United States of America and Canada.

Installing
----------

[](#installing)

`composer require treehousetim/bank-holidays`

Canada
------

[](#canada)

Canadian bank holidays are difficult to find authoritative information for. I've done the best I can with current information. Open an issue if you find authoritative sources of the rules to follow (not just a list of dates).

### List of Canadian Bank Holidays

[](#list-of-canadian-bank-holidays)

- New Year's Day;
- Family Day;
- Good Friday;
- Easter Monday;
- Victoria Day;
- Canada Day;
- Civic Holiday;
- Labor Day;
- Thanksgiving Day;
- Remembrance Day;
- Christmas Day;
- Boxing Day;

United States
-------------

[](#united-states)

Not all holidays are observed as bank holidays in the United States. If a holiday falls on a Saturday, it is not observed. If it falls on a Sunday it is observed on Monday.

### List of US Bank Holidays

[](#list-of-us-bank-holidays)

- New Year's Day
- Martin Luther King Jr. Day
- Presidents' Day
- Memorial Day
- Juneteenth
- Independence Day
- Labor Day
- Columbus Day
- Veterans Day
- Thanksgiving Day
- Christmas Day

Getting Detail
--------------

[](#getting-detail)

Both `usa` and `canada` classes implement the following abstract methods.

```
abstract public function getAsArray() : array;
abstract public function getObservedAsArray() : array;
```

The arrays returned by these methods are guaranteed (and enforced by unit tests) to contain the following array keys `country`, `observed`, `date`, `desc`

### `getAsArray()`

[](#getasarray)

This will return an array of all holiday date details regardless of whether or not they are observed by that country's banks.

### `getObservedAsArray()`

[](#getobservedasarray)

This will return all observed bank holidays for the year supplied to the library.

### `get[HolidayName]Detail()`

[](#getholidaynamedetail)

This will return a single holiday's detail array described above.

```
