generated from spatie/package-skeleton-php
-
-
Notifications
You must be signed in to change notification settings - Fork 196
/
Hungary.php
39 lines (33 loc) · 1.01 KB
/
Hungary.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
32
33
34
35
36
37
38
39
<?php
namespace Spatie\Holidays\Countries;
use Carbon\CarbonImmutable;
class Hungary extends Country
{
public function countryCode(): string
{
return 'hu';
}
protected function allHolidays(int $year): array
{
return array_merge([
'Újév' => '01-01',
'1848-as forradalom évfordulója' => '03-15',
'A munka ünnepe' => '05-01',
'Államalapítás ünnepe' => '08-20',
'1956-os forradalom évfordulója' => '10-23',
'Mindenszentek' => '11-01',
'Karácsony' => '12-25',
'Karácsony másnapja' => '12-26',
], $this->variableHolidays($year));
}
/** @return array<string, CarbonImmutable> */
protected function variableHolidays(int $year): array
{
$easter = $this->easter($year);
return [
'Nagypéntek' => $easter->subDays(2),
'Húsvéthétfő' => $easter->addDay(),
'Pünkösdhétfő' => $easter->addDays(50),
];
}
}