Skip to content

Commit

Permalink
feat: add liechtenstein
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Welte committed Jan 17, 2024
1 parent 9927780 commit 51b800e
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/Countries/Liechtenstein.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Spatie\Holidays\Countries;

use Carbon\CarbonImmutable;

class Liechtenstein extends Country
{
public function countryCode(): string
{
return 'li';
}

/** @return array<string, string|CarbonImmutable> */
protected function allHolidays(int $year): array
{
return array_merge([
'Neujahr' => '01-01',
'Heilige Drei Könige' => '01-06',
'Tag der Arbeit' => '05-01',
'Staatsfeiertag / Mariä Himmelfahrt' => '08-15',
'Mariä Geburt' => '09-08',
'Allerheiligen' => '11-01',
'Mariä Empfängnis' => '12-08',
'Weihnachten' => '12-25',
'Stephanstag' => '12-26',
], $this->variableHolidays($year));
}

/** @return array<string, CarbonImmutable> */
protected function variableHolidays(int $year): array
{
$easter = CarbonImmutable::createFromTimestamp(easter_date($year))
->setTimezone('Europe/Vaduz');

return [
'Ostermontag' => $easter->addDay(),
'Auffahrt' => $easter->addDays(39),
'Pfingstmontag' => $easter->addDays(50),
'Fronleichnam' => $easter->addDays(60),
];
}
}

0 comments on commit 51b800e

Please sign in to comment.