-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUsaHoliday.php
31 lines (26 loc) · 1.07 KB
/
UsaHoliday.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
namespace Holiday\Country;
use Holiday\Model\AbstractHoliday;
class UsaHoliday extends AbstractHoliday
{
public static function getHolidays($year = null)
{
//@see http://www.theholidayschedule.com/banks/us-bank-holidays.php
$year === null ? $year = intval(date('Y')) : $year = intval($year);
$holidays = [
new \DateTime(sprintf('%d-%d-%d', $year, 1, 1)),
new \DateTime(sprintf('%d-%d-%d', $year, 1, 18)),
parent::getEasterDate($year),
new \DateTime(sprintf('%d-%d-%d', $year, 5, 30)),
new \DateTime(sprintf('%d-%d-%d', $year, 7, 4)),
new \DateTime(sprintf('%d-%d-%d', $year, 9, 5)),
new \DateTime(sprintf('%d-%d-%d', $year, 11, 11)),
new \DateTime(sprintf('%d-%d-%d', $year, 11, 24)),
new \DateTime(sprintf('%d-%d-%d', $year, 12, 24)),
new \DateTime(sprintf('%d-%d-%d', $year, 12, 26)),
new \DateTime(sprintf('%d-%d-%d', $year, 12, 31)),
];
sort($holidays);
return $holidays;
}
}