diff --git a/src/Countries/Moldova.php b/src/Countries/Moldova.php new file mode 100644 index 000000000..aadae2468 --- /dev/null +++ b/src/Countries/Moldova.php @@ -0,0 +1,41 @@ + '01-01', + 'Crăciunul pe stil vechi' => '01-07', + 'A doua zi de Crăciun pe stil vechi' => '01-08', + 'Ziua Internațională a Femeii' => '03-08', + 'Ziua Muncii' => '05-01', + 'Ziua Europei' => '05-09', + 'Ziua Internațională a Copilului' => '06-01', + 'Ziua Independenței' => '08-27', + 'Ziua Limbii Române' => '08-31', + 'Crăciunul pe stil nou' => '12-25', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = $this->orthodoxEaster($year); + + return [ + 'Prima zi de Paște' => $easter, + 'A doua zi de Paște' => $easter->addDay(), + 'Paștele Blajinilor' => $easter->addDays(8), + ]; + } +} diff --git a/src/Countries/Slovenia.php b/src/Countries/Slovenia.php new file mode 100644 index 000000000..4f2171d50 --- /dev/null +++ b/src/Countries/Slovenia.php @@ -0,0 +1,42 @@ + '01-01', // New Year's Day + 'Novo leto 2' => '01-02', // New Year's Day, yes it's a second day + 'Prešernov dan, slovenski kulturni praznik' => '08-02', // Prešeren Day, Slovenian Cultural Holiday + 'Dan upora proti okupatorju' => '04-27', // Day of Uprising Against Occupation + 'Praznik dela' => '05-01', // Labour Day + 'Praznik dela 2' => '05-02', // Labour Day, yes it's a second day + 'Dan državnosti' => '06-25', // Statehood Day + 'Marijino vnebovzetje' => '08-15', // Assumption of Mary + 'Dan reformacije' => '10-31', // Reformation Day + 'Dan spomina na mrtve' => '11-01', // Remembrance Day + 'Božič' => '12-25', // Christmas Day + 'Dan samostojnosti in enotnosti' => '12-26', // Independence and Unity Day + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = $this->easter($year); + + return [ + 'Velikonočni ponedeljek' => $easter->addDay(), // Easter Monday + ]; + } +} diff --git a/tests/.pest/snapshots/Countries/MoldovaTest/it_can_calculate_moldavian_holidays.snap b/tests/.pest/snapshots/Countries/MoldovaTest/it_can_calculate_moldavian_holidays.snap new file mode 100644 index 000000000..9d18ecd37 --- /dev/null +++ b/tests/.pest/snapshots/Countries/MoldovaTest/it_can_calculate_moldavian_holidays.snap @@ -0,0 +1,54 @@ +[ + { + "name": "Anul Nou", + "date": "2024-01-01" + }, + { + "name": "Cr\u0103ciunul pe stil vechi", + "date": "2024-01-07" + }, + { + "name": "A doua zi de Cr\u0103ciun pe stil vechi", + "date": "2024-01-08" + }, + { + "name": "Ziua Interna\u021bional\u0103 a Femeii", + "date": "2024-03-08" + }, + { + "name": "Ziua Muncii", + "date": "2024-05-01" + }, + { + "name": "Prima zi de Pa\u0219te", + "date": "2024-05-05" + }, + { + "name": "A doua zi de Pa\u0219te", + "date": "2024-05-06" + }, + { + "name": "Ziua Europei", + "date": "2024-05-09" + }, + { + "name": "Pa\u0219tele Blajinilor", + "date": "2024-05-13" + }, + { + "name": "Ziua Interna\u021bional\u0103 a Copilului", + "date": "2024-06-01" + }, + { + "name": "Ziua Independen\u021bei", + "date": "2024-08-27" + }, + { + "name": "Ziua Limbii Rom\u00e2ne", + "date": "2024-08-31" + }, + { + "name": "Cr\u0103ciunul pe stil nou", + "date": "2024-12-25" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/SloveniaTest/it_can_calculate_slovenian_holidays.snap b/tests/.pest/snapshots/Countries/SloveniaTest/it_can_calculate_slovenian_holidays.snap new file mode 100644 index 000000000..b869f39b7 --- /dev/null +++ b/tests/.pest/snapshots/Countries/SloveniaTest/it_can_calculate_slovenian_holidays.snap @@ -0,0 +1,54 @@ +[ + { + "name": "Novo leto", + "date": "2024-01-01" + }, + { + "name": "Novo leto 2", + "date": "2024-01-02" + }, + { + "name": "Velikono\u010dni ponedeljek", + "date": "2024-04-01" + }, + { + "name": "Dan upora proti okupatorju", + "date": "2024-04-27" + }, + { + "name": "Praznik dela", + "date": "2024-05-01" + }, + { + "name": "Praznik dela 2", + "date": "2024-05-02" + }, + { + "name": "Dan dr\u017eavnosti", + "date": "2024-06-25" + }, + { + "name": "Pre\u0161ernov dan, slovenski kulturni praznik", + "date": "2024-08-02" + }, + { + "name": "Marijino vnebovzetje", + "date": "2024-08-15" + }, + { + "name": "Dan reformacije", + "date": "2024-10-31" + }, + { + "name": "Dan spomina na mrtve", + "date": "2024-11-01" + }, + { + "name": "Bo\u017ei\u010d", + "date": "2024-12-25" + }, + { + "name": "Dan samostojnosti in enotnosti", + "date": "2024-12-26" + } +] \ No newline at end of file diff --git a/tests/Countries/MoldovaTest.php b/tests/Countries/MoldovaTest.php new file mode 100644 index 000000000..02ac0db64 --- /dev/null +++ b/tests/Countries/MoldovaTest.php @@ -0,0 +1,19 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); + +}); diff --git a/tests/Countries/SloveniaTest.php b/tests/Countries/SloveniaTest.php new file mode 100644 index 000000000..0dc846a6e --- /dev/null +++ b/tests/Countries/SloveniaTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +});