From 3926bee9192862030eacc6a8c29debc655cc6096 Mon Sep 17 00:00:00 2001 From: Miril Terolli Date: Sun, 21 Jan 2024 19:35:38 -0500 Subject: [PATCH 1/8] Albanian National Holidays - Add Albanian national holidays including tentative dates for islamic holidays that are TBD. - Test coverage. --- src/Countries/Albania.php | 94 +++++++++++++++++++ .../it_can_calculate_albanian_holidays.snap | 54 +++++++++++ tests/Countries/AlbaniaTest.php | 17 ++++ 3 files changed, 165 insertions(+) create mode 100644 src/Countries/Albania.php create mode 100644 tests/.pest/snapshots/Countries/AlbaniaTest/it_can_calculate_albanian_holidays.snap create mode 100644 tests/Countries/AlbaniaTest.php diff --git a/src/Countries/Albania.php b/src/Countries/Albania.php new file mode 100644 index 000000000..3a904f00f --- /dev/null +++ b/src/Countries/Albania.php @@ -0,0 +1,94 @@ + '01-01', + 'Dita e Verës' => '03-14', + 'Dita e Sulltan Nevruzit' => '03-22', + 'Dita Ndërkombëtare e Punëtorëve' => '05-01', + 'Dita e Shenjtërimit të Shenjt Terezës' => '09-05', + 'Dita e Pavarësisë' => '11-28', + 'Dita e Çlirimit' => '11-29', + 'Dita Kombëtare e Rinisë' => '12-08', + 'Krishtlindjet' => '12-25', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + return [ + 'E diela e Pashkëve Katolike' => $this->easter($year), + 'E diela e Pashkëve Ortodokse' => $this->orthodoxEaster($year), + 'Dita e Bajramit të Madh' => $this->getEidAlFitrHoliday($year), + 'Dita e Kurban Bajramit' => $this->getEidAlAdhaHoliday($year), + ]; + } + + /** + * + */ + private function getEidAlFitrHoliday(int $year): CarbonImmutable + { + /** + * Provided until 2034 by qppstudio.net. + * https://www.qppstudio.net/global-holidays-observances/eid-al-fitr-end-of-ramadan.htm + */ + $date = match ($year) { + 2024 => '04-10', + 2025 => '03-30', + 2026 => '03-20', + 2027 => '03-09', + 2028 => '02-26', + 2029 => '02-14', + 2030 => '02-04', + 2031 => '01-24', + 2032 => '01-14', + 2033 => '01-02', + 2034 => '12-12', + default => '01-01' // Temporary placeholder; requires ongoing maintenance. + }; + + return CarbonImmutable::createFromFormat('Y-m-d', "$year-$date") + ->startOfDay(); + } + + private function getEidAlAdhaHoliday(int $year): CarbonImmutable + { + /** + * Tentative dates. + * Provided until 2034 by timeanddate.com. + * https://www.timeanddate.com/holidays/us/eid-al-adha + */ + $date = match ($year) { + 2024 => '06-17', + 2025 => '06-07', + 2026 => '05-27', + 2027 => '05-17', + 2028 => '05-05', + 2029 => '04-24', + 2030 => '04-14', + 2031 => '04-03', + 2032 => '03-22', + 2033 => '03-12', + 2034 => '03-01', + default => '01-01' // Temporary placeholder; requires ongoing maintenance. + }; + + return CarbonImmutable::createFromFormat('Y-m-d', "$year-$date") + ->startOfDay(); + } + +} diff --git a/tests/.pest/snapshots/Countries/AlbaniaTest/it_can_calculate_albanian_holidays.snap b/tests/.pest/snapshots/Countries/AlbaniaTest/it_can_calculate_albanian_holidays.snap new file mode 100644 index 000000000..f396ce838 --- /dev/null +++ b/tests/.pest/snapshots/Countries/AlbaniaTest/it_can_calculate_albanian_holidays.snap @@ -0,0 +1,54 @@ +[ + { + "name": "Viti i Ri", + "date": "2024-01-01" + }, + { + "name": "Dita e Ver\u00ebs", + "date": "2024-03-14" + }, + { + "name": "Dita e Sulltan Nevruzit", + "date": "2024-03-22" + }, + { + "name": "E diela e Pashk\u00ebve Katolike", + "date": "2024-03-31" + }, + { + "name": "Dita e Bajramit t\u00eb Madh", + "date": "2024-04-10" + }, + { + "name": "Dita Nd\u00ebrkomb\u00ebtare e Pun\u00ebtor\u00ebve", + "date": "2024-05-01" + }, + { + "name": "E diela e Pashk\u00ebve Ortodokse", + "date": "2024-05-05" + }, + { + "name": "Dita e Kurban Bajramit", + "date": "2024-06-17" + }, + { + "name": "Dita e Shenjt\u00ebrimit t\u00eb Shenjt Terez\u00ebs", + "date": "2024-09-05" + }, + { + "name": "Dita e Pavar\u00ebsis\u00eb", + "date": "2024-11-28" + }, + { + "name": "Dita e \u00c7lirimit", + "date": "2024-11-29" + }, + { + "name": "Dita Komb\u00ebtare e Rinis\u00eb", + "date": "2024-12-08" + }, + { + "name": "Krishtlindjet", + "date": "2024-12-25" + } +] \ No newline at end of file diff --git a/tests/Countries/AlbaniaTest.php b/tests/Countries/AlbaniaTest.php new file mode 100644 index 000000000..da22a2415 --- /dev/null +++ b/tests/Countries/AlbaniaTest.php @@ -0,0 +1,17 @@ +get(); + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From 0cfd45cce79f7def34780d5b5ae9f91c4cdf7e0d Mon Sep 17 00:00:00 2001 From: Miril Terolli Date: Sun, 21 Jan 2024 20:56:46 -0500 Subject: [PATCH 2/8] Albanian National Holidays - Add test coverage for holidays with standard dates. --- tests/Countries/AlbaniaTest.php | 106 ++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/tests/Countries/AlbaniaTest.php b/tests/Countries/AlbaniaTest.php index da22a2415..b5e168511 100644 --- a/tests/Countries/AlbaniaTest.php +++ b/tests/Countries/AlbaniaTest.php @@ -15,3 +15,109 @@ expect(formatDates($holidays))->toMatchSnapshot(); }); + + +it('does not return a holiday falsely', function() use ($holiday) { + $dateInstance = CarbonImmutable::createFromDate('2024-01-03'); + $holiday = Holidays::for(country: 'al'); + + $isHoliday = $holiday->isHoliday($dateInstance); + expect($isHoliday)->toBeFalse(); + + $holidayName = $holiday->getName($dateInstance); + expect($holidayName)->toBeNull(); +}); + +describe('national holidays with standard dates', function() { + $holiday = Holidays::for(country: 'al'); + + it('can calculate the `Viti i Ri` holiday as expected', function() use ($holiday) { + $dateInstance = CarbonImmutable::createFromDate('2024-01-01'); + + $isHoliday = $holiday->isHoliday($dateInstance); + expect($isHoliday)->toBeTrue(); + + $holidayName = $holiday->getName($dateInstance); + expect($holidayName)->toBe('Viti i Ri'); + }); + + it('can calculate the `Dita e Verës` holiday as expected', function() use ($holiday) { + $dateInstance = CarbonImmutable::createFromDate('2024-03-14'); + + $isHoliday = $holiday->isHoliday($dateInstance); + expect($isHoliday)->toBeTrue(); + + $holidayName = $holiday->getName($dateInstance); + expect($holidayName)->toBe('Dita e Verës'); + }); + + it('can calculate the `Dita e Sulltan Nevruzit` holiday as expected', function() use ($holiday) { + $dateInstance = CarbonImmutable::createFromDate('2024-03-22'); + + $isHoliday = $holiday->isHoliday($dateInstance); + expect($isHoliday)->toBeTrue(); + + $holidayName = $holiday->getName($dateInstance); + expect($holidayName)->toBe('Dita e Sulltan Nevruzit'); + }); + + it('can calculate the `Dita Ndërkombëtare e Punëtorëve` holiday as expected', function() use ($holiday) { + $dateInstance = CarbonImmutable::createFromDate('2024-05-01'); + + $isHoliday = $holiday->isHoliday($dateInstance); + expect($isHoliday)->toBeTrue(); + + $holidayName = $holiday->getName($dateInstance); + expect($holidayName)->toBe('Dita Ndërkombëtare e Punëtorëve'); + }); + + it('can calculate the `Dita e Shenjtërimit të Shenjt Terezës` holiday as expected', function() use ($holiday) { + $dateInstance = CarbonImmutable::createFromDate('2024-09-05'); + + $isHoliday = $holiday->isHoliday($dateInstance); + expect($isHoliday)->toBeTrue(); + + $holidayName = $holiday->getName($dateInstance); + expect($holidayName)->toBe('Dita e Shenjtërimit të Shenjt Terezës'); + }); + + it('can calculate the `Dita e Pavarësisë` holiday as expected', function() use ($holiday) { + $dateInstance = CarbonImmutable::createFromDate('2024-11-28'); + + $isHoliday = $holiday->isHoliday($dateInstance); + expect($isHoliday)->toBeTrue(); + + $holidayName = $holiday->getName($dateInstance); + expect($holidayName)->toBe('Dita e Pavarësisë'); + }); + + it('can calculate the `Dita e Çlirimit` holiday as expected', function() use ($holiday) { + $dateInstance = CarbonImmutable::createFromDate('2024-11-29'); + + $isHoliday = $holiday->isHoliday($dateInstance); + expect($isHoliday)->toBeTrue(); + + $holidayName = $holiday->getName($dateInstance); + expect($holidayName)->toBe('Dita e Çlirimit'); + }); + + it('can calculate the `Dita Kombëtare e Rinisë` holiday as expected', function() use ($holiday) { + $dateInstance = CarbonImmutable::createFromDate('2024-12-08'); + + $isHoliday = $holiday->isHoliday($dateInstance); + expect($isHoliday)->toBeTrue(); + + $holidayName = $holiday->getName($dateInstance); + expect($holidayName)->toBe('Dita Kombëtare e Rinisë'); + }); + + it('can calculate the `Krishtlindjet` holiday as expected', function() use ($holiday) { + $dateInstance = CarbonImmutable::createFromDate('2024-12-25'); + + $isHoliday = $holiday->isHoliday($dateInstance); + expect($isHoliday)->toBeTrue(); + + $holidayName = $holiday->getName($dateInstance); + expect($holidayName)->toBe('Krishtlindjet'); + }); + }); \ No newline at end of file From 97486d08a54bc6d8610c4c24c06d318064b3e863 Mon Sep 17 00:00:00 2001 From: Miril Terolli Date: Sun, 21 Jan 2024 20:58:02 -0500 Subject: [PATCH 3/8] Enhancements - Add empty line in the end of the testing file. --- tests/Countries/AlbaniaTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Countries/AlbaniaTest.php b/tests/Countries/AlbaniaTest.php index b5e168511..454277be4 100644 --- a/tests/Countries/AlbaniaTest.php +++ b/tests/Countries/AlbaniaTest.php @@ -120,4 +120,5 @@ $holidayName = $holiday->getName($dateInstance); expect($holidayName)->toBe('Krishtlindjet'); }); - }); \ No newline at end of file + }); + \ No newline at end of file From 565f580d9dfb8f4c48b6418df3b1d70714226a66 Mon Sep 17 00:00:00 2001 From: Miril Terolli Date: Sun, 21 Jan 2024 20:58:50 -0500 Subject: [PATCH 4/8] Enhancements - Fix empty line warning in the end of the file. --- tests/Countries/AlbaniaTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Countries/AlbaniaTest.php b/tests/Countries/AlbaniaTest.php index 454277be4..dfbcbd907 100644 --- a/tests/Countries/AlbaniaTest.php +++ b/tests/Countries/AlbaniaTest.php @@ -121,4 +121,3 @@ expect($holidayName)->toBe('Krishtlindjet'); }); }); - \ No newline at end of file From c5cf0e8aa08757106c58d05b92c9943272713668 Mon Sep 17 00:00:00 2001 From: Miril Terolli Date: Tue, 23 Jan 2024 14:35:52 -0500 Subject: [PATCH 5/8] Fixes - Fix php stan error. --- src/Countries/Albania.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Countries/Albania.php b/src/Countries/Albania.php index 3a904f00f..563f942ea 100644 --- a/src/Countries/Albania.php +++ b/src/Countries/Albania.php @@ -26,7 +26,7 @@ protected function allHolidays(int $year): array ], $this->variableHolidays($year)); } - /** @return array */ + /** @return array */ protected function variableHolidays(int $year): array { return [ @@ -40,13 +40,13 @@ protected function variableHolidays(int $year): array /** * */ - private function getEidAlFitrHoliday(int $year): CarbonImmutable + private function getEidAlFitrHoliday(int $year): string { /** * Provided until 2034 by qppstudio.net. * https://www.qppstudio.net/global-holidays-observances/eid-al-fitr-end-of-ramadan.htm */ - $date = match ($year) { + return match ($year) { 2024 => '04-10', 2025 => '03-30', 2026 => '03-20', @@ -60,19 +60,16 @@ private function getEidAlFitrHoliday(int $year): CarbonImmutable 2034 => '12-12', default => '01-01' // Temporary placeholder; requires ongoing maintenance. }; - - return CarbonImmutable::createFromFormat('Y-m-d', "$year-$date") - ->startOfDay(); } - private function getEidAlAdhaHoliday(int $year): CarbonImmutable + private function getEidAlAdhaHoliday(int $year): string { /** * Tentative dates. * Provided until 2034 by timeanddate.com. * https://www.timeanddate.com/holidays/us/eid-al-adha */ - $date = match ($year) { + return match ($year) { 2024 => '06-17', 2025 => '06-07', 2026 => '05-27', @@ -86,9 +83,6 @@ private function getEidAlAdhaHoliday(int $year): CarbonImmutable 2034 => '03-01', default => '01-01' // Temporary placeholder; requires ongoing maintenance. }; - - return CarbonImmutable::createFromFormat('Y-m-d', "$year-$date") - ->startOfDay(); } } From 384dc3a8f7a0822bbde916828b60883f7acd8242 Mon Sep 17 00:00:00 2001 From: Miril Terolli Date: Tue, 23 Jan 2024 15:14:56 -0500 Subject: [PATCH 6/8] Fix holiday TYPO. --- src/Countries/Albania.php | 2 +- .../AlbaniaTest/it_can_calculate_albanian_holidays.snap | 2 +- tests/Countries/AlbaniaTest.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Countries/Albania.php b/src/Countries/Albania.php index 563f942ea..a966c0cd2 100644 --- a/src/Countries/Albania.php +++ b/src/Countries/Albania.php @@ -22,7 +22,7 @@ protected function allHolidays(int $year): array 'Dita e Pavarësisë' => '11-28', 'Dita e Çlirimit' => '11-29', 'Dita Kombëtare e Rinisë' => '12-08', - 'Krishtlindjet' => '12-25', + 'Krishtlindja' => '12-25', ], $this->variableHolidays($year)); } diff --git a/tests/.pest/snapshots/Countries/AlbaniaTest/it_can_calculate_albanian_holidays.snap b/tests/.pest/snapshots/Countries/AlbaniaTest/it_can_calculate_albanian_holidays.snap index f396ce838..49c936114 100644 --- a/tests/.pest/snapshots/Countries/AlbaniaTest/it_can_calculate_albanian_holidays.snap +++ b/tests/.pest/snapshots/Countries/AlbaniaTest/it_can_calculate_albanian_holidays.snap @@ -48,7 +48,7 @@ "date": "2024-12-08" }, { - "name": "Krishtlindjet", + "name": "Krishtlindja", "date": "2024-12-25" } ] \ No newline at end of file diff --git a/tests/Countries/AlbaniaTest.php b/tests/Countries/AlbaniaTest.php index dfbcbd907..e068877b7 100644 --- a/tests/Countries/AlbaniaTest.php +++ b/tests/Countries/AlbaniaTest.php @@ -111,13 +111,13 @@ expect($holidayName)->toBe('Dita Kombëtare e Rinisë'); }); - it('can calculate the `Krishtlindjet` holiday as expected', function() use ($holiday) { + it('can calculate the `Krishtlindja` holiday as expected', function() use ($holiday) { $dateInstance = CarbonImmutable::createFromDate('2024-12-25'); $isHoliday = $holiday->isHoliday($dateInstance); expect($isHoliday)->toBeTrue(); $holidayName = $holiday->getName($dateInstance); - expect($holidayName)->toBe('Krishtlindjet'); + expect($holidayName)->toBe('Krishtlindja'); }); }); From 2042fd688f1b00f2179d76aed239fd502fdd06d0 Mon Sep 17 00:00:00 2001 From: Miril Terolli Date: Sat, 27 Jan 2024 19:17:06 -0500 Subject: [PATCH 7/8] Language support - Translation for German, English, Spanish, French, Greek, Italian, Portughese, Russian, Turkish. --- src/lang/albania/de/holidays.json | 15 +++++++++++++++ src/lang/albania/en/holidays.json | 15 +++++++++++++++ src/lang/albania/es/holidays.json | 15 +++++++++++++++ src/lang/albania/fr/holidays.json | 16 ++++++++++++++++ src/lang/albania/gr/holidays.json | 15 +++++++++++++++ src/lang/albania/it/holidays.json | 15 +++++++++++++++ src/lang/albania/pt/holidays.json | 15 +++++++++++++++ src/lang/albania/ru/holidays.json | 15 +++++++++++++++ src/lang/albania/tr/holidays.json | 15 +++++++++++++++ 9 files changed, 136 insertions(+) create mode 100644 src/lang/albania/de/holidays.json create mode 100644 src/lang/albania/en/holidays.json create mode 100644 src/lang/albania/es/holidays.json create mode 100644 src/lang/albania/fr/holidays.json create mode 100644 src/lang/albania/gr/holidays.json create mode 100644 src/lang/albania/it/holidays.json create mode 100644 src/lang/albania/pt/holidays.json create mode 100644 src/lang/albania/ru/holidays.json create mode 100644 src/lang/albania/tr/holidays.json diff --git a/src/lang/albania/de/holidays.json b/src/lang/albania/de/holidays.json new file mode 100644 index 000000000..ec5d24885 --- /dev/null +++ b/src/lang/albania/de/holidays.json @@ -0,0 +1,15 @@ +{ + "Viti i Ri": "Neujahr", + "Dita e Verës": "Sommertag", + "Dita e Sulltan Nevruzit": "Tag des Sultan Nevruz", + "Dita Ndërkombëtare e Punëtorëve": "Tag der Arbeit", + "Dita e Shenjtërimit të Shenjt Terezës": "Tag der Heiligsprechung der Heiligen Teresa", + "Dita e Pavarësisë": "Unabhängigkeitstag", + "Dita e Çlirimit": "Befreiungstag", + "Dita Kombëtare e Rinisë": "Nationaler Jugendtag", + "Krishtlindja": "Weihnachten", + "E diela e Pashkëve Katolike": "Katholischer Ostersonntag", + "E diela e Pashkëve Ortodokse": "Orthodoxer Ostersonntag", + "Dita e Bajramit të Madh": "Eid al-Fitr", + "Dita e Kurban Bajramit": "Eid al-Adha" +} diff --git a/src/lang/albania/en/holidays.json b/src/lang/albania/en/holidays.json new file mode 100644 index 000000000..df15b5c2f --- /dev/null +++ b/src/lang/albania/en/holidays.json @@ -0,0 +1,15 @@ +{ + "Viti i Ri": "New Year's Day", + "Dita e Verës": "Summer Day", + "Dita e Sulltan Nevruzit": "Sultan Nevruz Day", + "Dita Ndërkombëtare e Punëtorëve": "International Workers' Day", + "Dita e Shenjtërimit të Shenjt Terezës": "Saint Teresa Canonization Day", + "Dita e Pavarësisë": "Independence Day", + "Dita e Çlirimit": "Liberation Day", + "Dita Kombëtare e Rinisë": "National Youth Day", + "Krishtlindja": "Christmas", + "E diela e Pashkëve Katolike": "Catholic Easter Sunday", + "E diela e Pashkëve Ortodokse": "Orthodox Easter Sunday", + "Dita e Bajramit të Madh": "Eid al-Fitr", + "Dita e Kurban Bajramit": "Eid al-Adha" +} diff --git a/src/lang/albania/es/holidays.json b/src/lang/albania/es/holidays.json new file mode 100644 index 000000000..713b70def --- /dev/null +++ b/src/lang/albania/es/holidays.json @@ -0,0 +1,15 @@ +{ + "Viti i Ri": "Año Nuevo", + "Dita e Verës": "Día del Verano", + "Dita e Sulltan Nevruzit": "Día del Sultan Nevruz", + "Dita Ndërkombëtare e Punëtorëve": "Día Internacional de los Trabajadores", + "Dita e Shenjtërimit të Shenjt Terezës": "Día de la Canonización de Santa Teresa", + "Dita e Pavarësisë": "Día de la Independencia", + "Dita e Çlirimit": "Día de la Liberación", + "Dita Kombëtare e Rinisë": "Día Nacional de la Juventud", + "Krishtlindja": "Navidad", + "E diela e Pashkëve Katolike": "Domingo de Pascua Católica", + "E diela e Pashkëve Ortodokse": "Domingo de Pascua Ortodoxa", + "Dita e Bajramit të Madh": "Eid al-Fitr", + "Dita e Kurban Bajramit": "Eid al-Adha" +} diff --git a/src/lang/albania/fr/holidays.json b/src/lang/albania/fr/holidays.json new file mode 100644 index 000000000..e2a7f2f05 --- /dev/null +++ b/src/lang/albania/fr/holidays.json @@ -0,0 +1,16 @@ +{ + "Viti i Ri": "Jour de l'An", + "Dita e Verës": "Jour de l'Été", + "Dita e Sulltan Nevruzit": "Jour du Sultan Nevruz", + "Dita Ndërkombëtare e Punëtorëve": "Fête du Travail", + "Dita e Shenjtërimit të Shenjt Terezës": "Jour de la Canonisation de Sainte Teresa", + "Dita e Pavarësisë": "Jour de l'Indépendance", + "Dita e Çlirimit": "Jour de la Libération", + "Dita Kombëtare e Rinisë": "Journée nationale de la jeunesse", + "Krishtlindja": "Noël", + "E diela e Pashkëve Katolike": "Dimanche de Pâques catholique", + "E diela e Pashkëve Ortodokse": "Dimanche de Pâques orthodoxe", + "Dita e Bajramit të Madh": "Aïd al-Fitr", + "Dita e Kurban Bajramit": "Aïd al-Adha" +} + diff --git a/src/lang/albania/gr/holidays.json b/src/lang/albania/gr/holidays.json new file mode 100644 index 000000000..a2e5d28e5 --- /dev/null +++ b/src/lang/albania/gr/holidays.json @@ -0,0 +1,15 @@ +{ + "Viti i Ri": "Πρωτοχρονιά (Protochroniá)", + "Dita e Verës": "Ημέρα του Καλοκαιριού (Iméra tou Kalokairioú)", + "Dita e Sulltan Nevruzit": "Ημέρα του Σουλτάν Nevruz (Iméra tou Soúltan Nevruz)", + "Dita Ndërkombëtare e Punëtorëve": "Διεθνής Ημέρα των Εργαζομένων (Diethnís Iméra ton Ergazoménon)", + "Dita e Shenjtërimit të Shenjt Terezës": "Ημέρα Κανονισμού της Αγίας Τερέζας (Iméra Kanonismoú tis Agías Terézas)", + "Dita e Pavarësisë": "Ημέρα Ανεξαρτησίας (Iméra Anexartisías)", + "Dita e Çlirimit": "Ημέρα Απελευθέρωσης (Iméra Apelafthéroses)", + "Dita Kombëtare e Rinisë": "Εθνική Ημέρα της Νεολαίας (Ethnikí Iméra tis Neoléas)", + "Krishtlindja": "Χριστούγεννα (Christoúgenna)", + "E diela e Pashkëve Katolike": "Κυριακή του Καθολικού Πάσχα (Kyriakí tou Katholikoú Páscha)", + "E diela e Pashkëve Ortodokse": "Κυριακή του Ορθόδοξου Πάσχα (Kyriakí tou Orthódoksi Páscha)", + "Dita e Bajramit të Madh": "Ημέρα του Μεγάλου Βαϊράμ (Iméra tou Megálou Vaïrám)", + "Dita e Kurban Bajramit": "Ημέρα του Κουρμπάν Βαϊράμ (Iméra tou Kourbán Vaïrám)" +} diff --git a/src/lang/albania/it/holidays.json b/src/lang/albania/it/holidays.json new file mode 100644 index 000000000..4e192da2a --- /dev/null +++ b/src/lang/albania/it/holidays.json @@ -0,0 +1,15 @@ +{ + "Viti i Ri": "Capodanno", + "Dita e Verës": "Giorno d'Estate", + "Dita e Sulltan Nevruzit": "Giorno del Sultano Nevruz", + "Dita Ndërkombëtare e Punëtorëve": "Festa dei Lavoratori", + "Dita e Shenjtërimit të Shenjt Terezës": "Giorno della Canonizzazione di Santa Teresa", + "Dita e Pavarësisë": "Giorno dell'Indipendenza", + "Dita e Çlirimit": "Giorno della Liberazione", + "Dita Kombëtare e Rinisë": "Giornata Nazionale della Gioventù", + "Krishtlindja": "Natale", + "E diela e Pashkëve Katolike": "Domenica di Pasqua Cattolica", + "E diela e Pashkëve Ortodokse": "Domenica di Pasqua Ortodossa", + "Dita e Bajramit të Madh": "Eid al-Fitr", + "Dita e Kurban Bajramit": "Eid al-Adha" +} diff --git a/src/lang/albania/pt/holidays.json b/src/lang/albania/pt/holidays.json new file mode 100644 index 000000000..dc3fce2f3 --- /dev/null +++ b/src/lang/albania/pt/holidays.json @@ -0,0 +1,15 @@ +{ + "Viti i Ri": "Ano Novo", + "Dita e Verës": "Dia do Verão", + "Dita e Sulltan Nevruzit": "Dia do Sultão Nevruz", + "Dita Ndërkombëtare e Punëtorëve": "Dia Internacional dos Trabalhadores", + "Dita e Shenjtërimit të Shenjt Terezës": "Dia da Canonização de Santa Teresa", + "Dita e Pavarësisë": "Dia da Independência", + "Dita e Çlirimit": "Dia da Libertação", + "Dita Kombëtare e Rinisë": "Dia Nacional da Juventude", + "Krishtlindja": "Natal", + "E diela e Pashkëve Katolike": "Domingo de Páscoa Católico", + "E diela e Pashkëve Ortodokse": "Domingo de Páscoa Ortodoxo", + "Dita e Bajramit të Madh": "Eid al-Fitr", + "Dita e Kurban Bajramit": "Eid al-Adha" +} diff --git a/src/lang/albania/ru/holidays.json b/src/lang/albania/ru/holidays.json new file mode 100644 index 000000000..2eb3f356d --- /dev/null +++ b/src/lang/albania/ru/holidays.json @@ -0,0 +1,15 @@ +{ + "Viti i Ri": "Новий рік", + "Dita e Verës": "День літа", + "Dita e Sulltan Nevruzit": "День Султана Невруза", + "Dita Ndërkombëtare e Punëtorëve": "Міжнародний день праці", + "Dita e Shenjtërimit të Shenjt Terezës": "День канонізації Святої Терези", + "Dita e Pavarësisë": "День Незалежності", + "Dita e Çlirimit": "День Визволення", + "Dita Kombëtare e Rinisë": "Національний день молоді", + "Krishtlindja": "Різдво", + "E diela e Pashkëve Katolike": "Католицька неділя Великодня", + "E diela e Pashkëve Ortodokse": "Православна неділя Великодня", + "Dita e Bajramit të Madh": "Байрам", + "Dita e Kurban Bajramit": "Курбан-байрам" +} diff --git a/src/lang/albania/tr/holidays.json b/src/lang/albania/tr/holidays.json new file mode 100644 index 000000000..ede076e01 --- /dev/null +++ b/src/lang/albania/tr/holidays.json @@ -0,0 +1,15 @@ +{ + "Viti i Ri": "Yılbaşı", + "Dita e Verës": "Yaz Günü", + "Dita e Sulltan Nevruzit": "Sultan Nevruz Günü", + "Dita Ndërkombëtare e Punëtorëve": "Uluslararası İşçi Günü", + "Dita e Shenjtërimit të Shenjt Terezës": "Azize Teresa'nın Kanonizasyon Günü", + "Dita e Pavarësisë": "Bağımsızlık Günü", + "Dita e Çlirimit": "Kurtuluş Günü", + "Dita Kombëtare e Rinisë": "Ulusal Gençlik Günü", + "Krishtlindja": "Noel", + "E diela e Pashkëve Katolike": "Katolik Paskalya Pazarı", + "E diela e Pashkëve Ortodokse": "Ortodoks Paskalya Pazarı", + "Dita e Bajramit të Madh": "Ramazan Bayramı", + "Dita e Kurban Bajramit": "Kurban Bayramı" +} From 41a01b1288e933af82cc62fcabbc7a832dd6ea80 Mon Sep 17 00:00:00 2001 From: Miril Terolli Date: Tue, 30 Jan 2024 07:12:25 -0500 Subject: [PATCH 8/8] Filter out some variable holidays when they are not set for the given year. --- src/Countries/Albania.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Countries/Albania.php b/src/Countries/Albania.php index a966c0cd2..42ad87619 100644 --- a/src/Countries/Albania.php +++ b/src/Countries/Albania.php @@ -29,18 +29,18 @@ protected function allHolidays(int $year): array /** @return array */ protected function variableHolidays(int $year): array { - return [ + return array_filter([ 'E diela e Pashkëve Katolike' => $this->easter($year), 'E diela e Pashkëve Ortodokse' => $this->orthodoxEaster($year), 'Dita e Bajramit të Madh' => $this->getEidAlFitrHoliday($year), 'Dita e Kurban Bajramit' => $this->getEidAlAdhaHoliday($year), - ]; + ]); } /** * */ - private function getEidAlFitrHoliday(int $year): string + private function getEidAlFitrHoliday(int $year): ?string { /** * Provided until 2034 by qppstudio.net. @@ -58,11 +58,11 @@ private function getEidAlFitrHoliday(int $year): string 2032 => '01-14', 2033 => '01-02', 2034 => '12-12', - default => '01-01' // Temporary placeholder; requires ongoing maintenance. + default => null // Holiday is variable; requires ongoing maintenance. }; } - private function getEidAlAdhaHoliday(int $year): string + private function getEidAlAdhaHoliday(int $year): ?string { /** * Tentative dates. @@ -81,7 +81,7 @@ private function getEidAlAdhaHoliday(int $year): string 2032 => '03-22', 2033 => '03-12', 2034 => '03-01', - default => '01-01' // Temporary placeholder; requires ongoing maintenance. + default => null // Holiday is variable; requires ongoing maintenance. }; }