From 12faaaceae25b16c8b40de39ea0d13490cc57581 Mon Sep 17 00:00:00 2001 From: Theron Smith Date: Wed, 17 Jan 2024 13:28:27 -0700 Subject: [PATCH 01/66] Add tests and implementation for calculating Canadian holidays in the Spatie\Holidays package. --- src/Countries/Canada.php | 83 +++++++++++++++++++ .../it_can_calculate_canadian_holidays.snap | 34 ++++++++ tests/Countries/CanadaTest.php | 18 ++++ 3 files changed, 135 insertions(+) create mode 100644 src/Countries/Canada.php create mode 100644 tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap create mode 100644 tests/Countries/CanadaTest.php diff --git a/src/Countries/Canada.php b/src/Countries/Canada.php new file mode 100644 index 00000000..edbf879c --- /dev/null +++ b/src/Countries/Canada.php @@ -0,0 +1,83 @@ + */ + protected function allHolidays(int $year): array + { + $easterSunday = $this->calculateEasterSunday($year); + $goodFriday = $easterSunday->subDays(2); + + return array_merge( + [ + 'New Year\'s Day' => new CarbonImmutable("$year-01-01", 'America/Toronto'), + 'Good Friday' => $goodFriday, + 'Victoria Day' => new CarbonImmutable("last monday of May $year", 'America/Toronto'), + 'Canada Day' => new CarbonImmutable("$year-07-01", 'America/Toronto'), + 'Civic Holiday' => new CarbonImmutable( + "first monday of August $year", 'America/Toronto' + ), + 'Labour Day' => new CarbonImmutable( + "first monday of September $year", 'America/Toronto' + ), + 'National Day for Truth and Reconciliation' => new CarbonImmutable( + "$year-10-30", + 'America/Toronto' + ), + 'Thanksgiving' => new CarbonImmutable( + "second monday of October $year", 'America/Toronto' + ), + 'Remembrance Day' => new CarbonImmutable("$year-11-11", 'America/Toronto'), + 'Christmas Day' => new CarbonImmutable("$year-12-25", 'America/Toronto'), + ], + $this->variableHolidays($year) + ); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $victoriaDay = new CarbonImmutable("last monday of May $year", 'America/Toronto'); + if ($victoriaDay->day < 25) { + $victoriaDay = $victoriaDay->addWeek(); + } + + $thanksgiving = new CarbonImmutable("second monday of October $year", 'America/Toronto'); + $boxingDay = new CarbonImmutable($year . '-12-26', 'America/Toronto'); + + return [ + 'Victoria Day' => $victoriaDay, + 'Thanksgiving' => $thanksgiving, + 'Boxing Day' => $boxingDay, + ]; + } + + private function calculateEasterSunday(int $year): CarbonImmutable + { + $a = $year % 19; + $b = intdiv($year, 100); + $c = $year % 100; + $d = intdiv($b, 4); + $e = $b % 4; + $f = intdiv($b + 8, 25); + $g = intdiv($b - $f + 1, 3); + $h = (19 * $a + $b - $d - $g + 15) % 30; + $i = intdiv($c, 4); + $k = $c % 4; + $l = (32 + 2 * $e + 2 * $i - $h - $k) % 7; + $m = intdiv($a + 11 * $h + 22 * $l, 451); + $month = intdiv($h + $l - 7 * $m + 114, 31); + $day = (($h + $l - 7 * $m + 114) % 31) + 1; + + return new CarbonImmutable("$year-$month-$day", 'America/Toronto'); + } +} diff --git a/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap b/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap new file mode 100644 index 00000000..7cecf1cc --- /dev/null +++ b/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap @@ -0,0 +1,34 @@ +[ + { + "name": "New Year's Day", + "date": "2024-01-01" + }, + { + "name": "Good Friday", + "date": "2024-03-29" + }, + { + "name": "Victoria Day", + "date": "2024-05-27" + }, + { + "name": "Canada Day", + "date": "2024-07-01" + }, + { + "name": "Labour Day", + "date": "2024-09-02" + }, + { + "name": "Thanksgiving", + "date": "2024-10-14" + }, + { + "name": "Christmas Day", + "date": "2024-12-25" + }, + { + "name": "Boxing Day", + "date": "2024-12-26" + } +] \ No newline at end of file diff --git a/tests/Countries/CanadaTest.php b/tests/Countries/CanadaTest.php new file mode 100644 index 00000000..0619c4ec --- /dev/null +++ b/tests/Countries/CanadaTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From a11a4db90653d1714a108ece659f56bea152e4db Mon Sep 17 00:00:00 2001 From: Theron Smith Date: Wed, 17 Jan 2024 13:30:43 -0700 Subject: [PATCH 02/66] Add Canadian holidays to the test snapshot for accurate calculations. --- .../it_can_calculate_canadian_holidays.snap | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap b/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap index 7cecf1cc..fbc41a1a 100644 --- a/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap +++ b/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap @@ -15,6 +15,10 @@ "name": "Canada Day", "date": "2024-07-01" }, + { + "name": "Civic Holiday", + "date": "2024-08-05" + }, { "name": "Labour Day", "date": "2024-09-02" @@ -23,6 +27,14 @@ "name": "Thanksgiving", "date": "2024-10-14" }, + { + "name": "National Day for Truth and Reconciliation", + "date": "2024-10-30" + }, + { + "name": "Remembrance Day", + "date": "2024-11-11" + }, { "name": "Christmas Day", "date": "2024-12-25" From 695713f3d6d4f656e5b8795c100988957d7ba881 Mon Sep 17 00:00:00 2001 From: Theron Smith Date: Wed, 17 Jan 2024 15:28:18 -0700 Subject: [PATCH 03/66] Refactor Canada.php to simplify and improve the implementation of holiday dates. --- src/Countries/Canada.php | 52 +++++++++++----------------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/src/Countries/Canada.php b/src/Countries/Canada.php index edbf879c..0805f59d 100644 --- a/src/Countries/Canada.php +++ b/src/Countries/Canada.php @@ -14,30 +14,23 @@ public function countryCode(): string /** @return array */ protected function allHolidays(int $year): array { - $easterSunday = $this->calculateEasterSunday($year); - $goodFriday = $easterSunday->subDays(2); - return array_merge( [ - 'New Year\'s Day' => new CarbonImmutable("$year-01-01", 'America/Toronto'), - 'Good Friday' => $goodFriday, - 'Victoria Day' => new CarbonImmutable("last monday of May $year", 'America/Toronto'), - 'Canada Day' => new CarbonImmutable("$year-07-01", 'America/Toronto'), + 'New Year\'s Day' => new CarbonImmutable($year . "-01-01", 'America/Toronto'), + 'Canada Day' => new CarbonImmutable($year . "-07-01", 'America/Toronto'), 'Civic Holiday' => new CarbonImmutable( - "first monday of August $year", 'America/Toronto' + "first monday of August " . $year, 'America/Toronto' ), 'Labour Day' => new CarbonImmutable( - "first monday of September $year", 'America/Toronto' + "first monday of September " . $year, 'America/Toronto' ), 'National Day for Truth and Reconciliation' => new CarbonImmutable( - "$year-10-30", + $year . "-10-30", 'America/Toronto' ), - 'Thanksgiving' => new CarbonImmutable( - "second monday of October $year", 'America/Toronto' - ), - 'Remembrance Day' => new CarbonImmutable("$year-11-11", 'America/Toronto'), - 'Christmas Day' => new CarbonImmutable("$year-12-25", 'America/Toronto'), + 'Remembrance Day' => new CarbonImmutable($year . "-11-11", 'America/Toronto'), + 'Christmas Day' => new CarbonImmutable($year . "-12-25", 'America/Toronto'), + 'Boxing Day' => new CarbonImmutable($year . '-12-26', 'America/Toronto'), ], $this->variableHolidays($year) ); @@ -46,38 +39,21 @@ protected function allHolidays(int $year): array /** @return array */ protected function variableHolidays(int $year): array { + $easterSunday = CarbonImmutable::createFromTimestamp(easter_date($year)) + ->setTimezone('America/Toronto'); + + $goodFriday = $easterSunday->subDays(2); + $victoriaDay = new CarbonImmutable("last monday of May $year", 'America/Toronto'); if ($victoriaDay->day < 25) { $victoriaDay = $victoriaDay->addWeek(); } $thanksgiving = new CarbonImmutable("second monday of October $year", 'America/Toronto'); - $boxingDay = new CarbonImmutable($year . '-12-26', 'America/Toronto'); - return [ 'Victoria Day' => $victoriaDay, + 'Good Friday' => $goodFriday, 'Thanksgiving' => $thanksgiving, - 'Boxing Day' => $boxingDay, ]; } - - private function calculateEasterSunday(int $year): CarbonImmutable - { - $a = $year % 19; - $b = intdiv($year, 100); - $c = $year % 100; - $d = intdiv($b, 4); - $e = $b % 4; - $f = intdiv($b + 8, 25); - $g = intdiv($b - $f + 1, 3); - $h = (19 * $a + $b - $d - $g + 15) % 30; - $i = intdiv($c, 4); - $k = $c % 4; - $l = (32 + 2 * $e + 2 * $i - $h - $k) % 7; - $m = intdiv($a + 11 * $h + 22 * $l, 451); - $month = intdiv($h + $l - 7 * $m + 114, 31); - $day = (($h + $l - 7 * $m + 114) % 31) + 1; - - return new CarbonImmutable("$year-$month-$day", 'America/Toronto'); - } } From 25164ea4753038f222806d0bc52d9ed29fed6c94 Mon Sep 17 00:00:00 2001 From: Theron Smith Date: Wed, 17 Jan 2024 15:34:05 -0700 Subject: [PATCH 04/66] Add Easter Sunday as a Canadian holiday in order to accurately calculate Canadian holidays. --- src/Countries/Canada.php | 1 + .../CanadaTest/it_can_calculate_canadian_holidays.snap | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/Countries/Canada.php b/src/Countries/Canada.php index 0805f59d..04dfba89 100644 --- a/src/Countries/Canada.php +++ b/src/Countries/Canada.php @@ -53,6 +53,7 @@ protected function variableHolidays(int $year): array return [ 'Victoria Day' => $victoriaDay, 'Good Friday' => $goodFriday, + 'Easter Sunday' => $easterSunday, 'Thanksgiving' => $thanksgiving, ]; } diff --git a/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap b/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap index fbc41a1a..f02c28c7 100644 --- a/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap +++ b/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap @@ -7,6 +7,10 @@ "name": "Good Friday", "date": "2024-03-29" }, + { + "name": "Easter Sunday", + "date": "2024-03-31" + }, { "name": "Victoria Day", "date": "2024-05-27" From a464c3ea3fffabce46d7ba461ef9cfe22e37b3d7 Mon Sep 17 00:00:00 2001 From: Theron Smith Date: Wed, 17 Jan 2024 15:36:30 -0700 Subject: [PATCH 05/66] Update National Day for Truth and Reconciliation to September 30th. --- src/Countries/Canada.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Countries/Canada.php b/src/Countries/Canada.php index 04dfba89..034f2eef 100644 --- a/src/Countries/Canada.php +++ b/src/Countries/Canada.php @@ -25,7 +25,7 @@ protected function allHolidays(int $year): array "first monday of September " . $year, 'America/Toronto' ), 'National Day for Truth and Reconciliation' => new CarbonImmutable( - $year . "-10-30", + $year . "-09-30", 'America/Toronto' ), 'Remembrance Day' => new CarbonImmutable($year . "-11-11", 'America/Toronto'), From 4e8fa475801187370134128c7d7ea69ca72498ad Mon Sep 17 00:00:00 2001 From: Theron Smith Date: Wed, 17 Jan 2024 15:55:19 -0700 Subject: [PATCH 06/66] Refactor Easter Sunday to Easter Monday. --- src/Countries/Canada.php | 3 ++- .../it_can_calculate_canadian_holidays.snap | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Countries/Canada.php b/src/Countries/Canada.php index 034f2eef..c7efc9e2 100644 --- a/src/Countries/Canada.php +++ b/src/Countries/Canada.php @@ -43,6 +43,7 @@ protected function variableHolidays(int $year): array ->setTimezone('America/Toronto'); $goodFriday = $easterSunday->subDays(2); + $easterMonday = $easterSunday->addDays(1); $victoriaDay = new CarbonImmutable("last monday of May $year", 'America/Toronto'); if ($victoriaDay->day < 25) { @@ -53,7 +54,7 @@ protected function variableHolidays(int $year): array return [ 'Victoria Day' => $victoriaDay, 'Good Friday' => $goodFriday, - 'Easter Sunday' => $easterSunday, + 'Easter Monday' => $easterMonday, 'Thanksgiving' => $thanksgiving, ]; } diff --git a/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap b/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap index f02c28c7..3168b8ea 100644 --- a/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap +++ b/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap @@ -8,8 +8,8 @@ "date": "2024-03-29" }, { - "name": "Easter Sunday", - "date": "2024-03-31" + "name": "Easter Monday", + "date": "2024-04-01" }, { "name": "Victoria Day", @@ -28,12 +28,12 @@ "date": "2024-09-02" }, { - "name": "Thanksgiving", - "date": "2024-10-14" + "name": "National Day for Truth and Reconciliation", + "date": "2024-09-30" }, { - "name": "National Day for Truth and Reconciliation", - "date": "2024-10-30" + "name": "Thanksgiving", + "date": "2024-10-14" }, { "name": "Remembrance Day", From 609e39118f3f2c76eb8cadbbad501c04314d565a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20=C3=87al=C4=B1=C5=9Fkan?= Date: Thu, 18 Jan 2024 12:09:03 +0300 Subject: [PATCH 07/66] Added Turkey holidays --- src/Countries/Turkey.php | 35 +++++++++++++++++++ .../it_can_calculate_turkey_holidays.snap | 30 ++++++++++++++++ tests/Countries/TurkeyTest.php | 18 ++++++++++ 3 files changed, 83 insertions(+) create mode 100644 src/Countries/Turkey.php create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap create mode 100644 tests/Countries/TurkeyTest.php diff --git a/src/Countries/Turkey.php b/src/Countries/Turkey.php new file mode 100644 index 00000000..986bb550 --- /dev/null +++ b/src/Countries/Turkey.php @@ -0,0 +1,35 @@ + */ + protected function allHolidays(int $year): array + { + return array_merge([ + 'Yılbaşı' => '01-01', + 'Ulusal Egemenlik ve Çocuk Bayramı' => '04-23', + 'Emek ve Dayanışma Günü' => '05-01', + 'Atatürk\'ü Anma, Gençlik ve Spor Bayramı' => '05-19', + 'Demokrasi ve Millî Birlik Günü' => '07-15', + 'Zafer Bayramı' => '08-30', + 'Cumhuriyet Bayramı' => '10-29', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + return [ + //It will be implemented after Islamic holidays + ]; + } +} diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap new file mode 100644 index 00000000..b46bd02f --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap @@ -0,0 +1,30 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/Countries/TurkeyTest.php b/tests/Countries/TurkeyTest.php new file mode 100644 index 00000000..7265a31f --- /dev/null +++ b/tests/Countries/TurkeyTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From 32087ea1e7a68e4ff4aed7011d66a9fa3417dc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20=C3=87al=C4=B1=C5=9Fkan?= Date: Thu, 18 Jan 2024 19:19:38 +0300 Subject: [PATCH 08/66] removed comment line --- src/Countries/Turkey.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Countries/Turkey.php b/src/Countries/Turkey.php index 986bb550..0095bbde 100644 --- a/src/Countries/Turkey.php +++ b/src/Countries/Turkey.php @@ -11,7 +11,6 @@ public function countryCode(): string return 'tr'; } - /** @return array */ protected function allHolidays(int $year): array { return array_merge([ From 43900643ab823e93d6a7da124b9b32d0b41f2839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20=C3=87al=C4=B1=C5=9Fkan?= Date: Thu, 18 Jan 2024 19:24:26 +0300 Subject: [PATCH 09/66] Added comment line for variable holidays --- src/Countries/Turkey.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Countries/Turkey.php b/src/Countries/Turkey.php index 0095bbde..50990037 100644 --- a/src/Countries/Turkey.php +++ b/src/Countries/Turkey.php @@ -28,7 +28,8 @@ protected function allHolidays(int $year): array protected function variableHolidays(int $year): array { return [ - //It will be implemented after Islamic holidays + //It will be implemented after Islamic holidays. Because Islamic holidays are lunar based. + //https://github.com/spatie/holidays/discussions/79 ]; } } From aeb6c129b8abfe01368269e46455d5eba1b0d3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20=C3=87al=C4=B1=C5=9Fkan?= Date: Thu, 18 Jan 2024 19:29:10 +0300 Subject: [PATCH 10/66] =?UTF-8?q?"Cumhuriyet=20Bayram=C4=B1=20Arifesi"=20h?= =?UTF-8?q?oliday=20day=20added.=20Because=20the=20eve=20is=20a=20half=20d?= =?UTF-8?q?ay=20holiday.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Source: https://tr.wikipedia.org/wiki/T%C3%BCrkiye%27deki_resm%C3%AE_tatiller --- src/Countries/Turkey.php | 1 + .../TurkeyTest/it_can_calculate_turkey_holidays.snap | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/Countries/Turkey.php b/src/Countries/Turkey.php index 50990037..58b6c13a 100644 --- a/src/Countries/Turkey.php +++ b/src/Countries/Turkey.php @@ -20,6 +20,7 @@ protected function allHolidays(int $year): array 'Atatürk\'ü Anma, Gençlik ve Spor Bayramı' => '05-19', 'Demokrasi ve Millî Birlik Günü' => '07-15', 'Zafer Bayramı' => '08-30', + 'Cumhuriyet Bayramı Arifesi' => '10-28', 'Cumhuriyet Bayramı' => '10-29', ], $this->variableHolidays($year)); } diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap index b46bd02f..e7826692 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap @@ -23,6 +23,10 @@ "name": "Zafer Bayram\u0131", "date": "2024-08-30" }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, { "name": "Cumhuriyet Bayram\u0131", "date": "2024-10-29" From 67b985e00ea636afc28255558f349da1a63ab3b5 Mon Sep 17 00:00:00 2001 From: kakajansh Date: Fri, 19 Jan 2024 00:16:51 +0500 Subject: [PATCH 11/66] Add Turkmenistan Holidays --- src/Countries/Turkmenistan.php | 75 +++++++++++++++++++ .../it_can_calculate_turkmen_holidays.snap | 50 +++++++++++++ tests/Countries/TurkmenistanTest.php | 18 +++++ 3 files changed, 143 insertions(+) create mode 100644 src/Countries/Turkmenistan.php create mode 100644 tests/.pest/snapshots/Countries/TurkmenistanTest/it_can_calculate_turkmen_holidays.snap create mode 100644 tests/Countries/TurkmenistanTest.php diff --git a/src/Countries/Turkmenistan.php b/src/Countries/Turkmenistan.php new file mode 100644 index 00000000..11004160 --- /dev/null +++ b/src/Countries/Turkmenistan.php @@ -0,0 +1,75 @@ + '01-01', + 'Halkara zenanlar güni' => '03-08', + 'Milli bahar baýramy 1-nji güni' => '03-21', + 'Milli bahar baýramy 2-nji güni' => '03-22', + 'Türkmenistanyň Konstitusiýasynyň we Türkmenistanyň Döwlet baýdagynyň güni' => '05-18', + 'Türkmenistanyň Garaşsyzlyk güni' => '09-27', + 'Hatyra güni' => '10-06', + 'Halkara Bitaraplyk güni' => '12-12', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + return [ + 'Oraza baýramy' => $this->islamicCalendar('01-10', $year), + 'Gurban baýramy 1-nji güni' => $this->islamicCalendar('10-12', $year), + 'Gurban baýramy 2-nji güni' => $this->islamicCalendar('11-12', $year), + 'Gurban baýramy 3-nji güni' => $this->islamicCalendar('12-12', $year), + ]; + } + + protected function islamicCalendar(string $input, int $year, $nextYear = false): string + { + $hijriYear = $this->getHijriYear(year: $year, nextYear: $nextYear); + $formatter = $this->getIslamicFormatter(); + + $timeStamp = $formatter->parse($input . '/' . $hijriYear . ' AH'); + $dateTime = date_create()->setTimeStamp($timeStamp)->setTimezone(new DateTimeZone($this->timezone)); + + return $dateTime->format('m-d'); + } + + protected function getIslamicFormatter(): IntlDateFormatter + { + return new IntlDateFormatter( + locale: 'en-SG@calendar=islamic-civil', + dateType: IntlDateFormatter::MEDIUM, + timeType: IntlDateFormatter::NONE, + timezone: $this->timezone, + calendar: IntlDateFormatter::TRADITIONAL + ); + } + + protected function getHijriYear(int $year, $nextYear = false): int + { + $formatter = $this->getIslamicFormatter(); + $formatter->setPattern('yyyy'); + $dateTime = DateTime::createFromFormat('d/m/Y', '01/01/' . ($nextYear ? $year + 1 : $year)); + + return (int) $formatter->format($dateTime); + } +} diff --git a/tests/.pest/snapshots/Countries/TurkmenistanTest/it_can_calculate_turkmen_holidays.snap b/tests/.pest/snapshots/Countries/TurkmenistanTest/it_can_calculate_turkmen_holidays.snap new file mode 100644 index 00000000..3f4a419d --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkmenistanTest/it_can_calculate_turkmen_holidays.snap @@ -0,0 +1,50 @@ +[ + { + "name": "T\u00e4ze \u00fdyl", + "date": "2024-01-01" + }, + { + "name": "Halkara zenanlar g\u00fcni", + "date": "2024-03-08" + }, + { + "name": "Milli bahar ba\u00fdramy 1-nji g\u00fcni", + "date": "2024-03-21" + }, + { + "name": "Milli bahar ba\u00fdramy 2-nji g\u00fcni", + "date": "2024-03-22" + }, + { + "name": "Oraza ba\u00fdramy", + "date": "2024-04-10" + }, + { + "name": "T\u00fcrkmenistany\u0148 Konstitusi\u00fdasyny\u0148 we T\u00fcrkmenistany\u0148 D\u00f6wlet ba\u00fddagyny\u0148 g\u00fcni", + "date": "2024-05-18" + }, + { + "name": "Gurban ba\u00fdramy 1-nji g\u00fcni", + "date": "2024-06-17" + }, + { + "name": "Gurban ba\u00fdramy 2-nji g\u00fcni", + "date": "2024-06-18" + }, + { + "name": "Gurban ba\u00fdramy 3-nji g\u00fcni", + "date": "2024-06-19" + }, + { + "name": "T\u00fcrkmenistany\u0148 Gara\u015fsyzlyk g\u00fcni", + "date": "2024-09-27" + }, + { + "name": "Hatyra g\u00fcni", + "date": "2024-10-06" + }, + { + "name": "Halkara Bitaraplyk g\u00fcni", + "date": "2024-12-12" + } +] \ No newline at end of file diff --git a/tests/Countries/TurkmenistanTest.php b/tests/Countries/TurkmenistanTest.php new file mode 100644 index 00000000..7f29d663 --- /dev/null +++ b/tests/Countries/TurkmenistanTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From b0a84654a80c190776a4bf6cb6234b1bac00d468 Mon Sep 17 00:00:00 2001 From: Tor Lindgaard Date: Thu, 18 Jan 2024 22:24:58 +0100 Subject: [PATCH 12/66] Add Norway Holidays --- src/Countries/Norway.php | 43 ++++++++++++++++ .../it_can_calculate_norwegian_holidays.snap | 50 +++++++++++++++++++ tests/Countries/NorwayTest.php | 18 +++++++ 3 files changed, 111 insertions(+) create mode 100644 src/Countries/Norway.php create mode 100644 tests/.pest/snapshots/Countries/NorwayTest/it_can_calculate_norwegian_holidays.snap create mode 100644 tests/Countries/NorwayTest.php diff --git a/src/Countries/Norway.php b/src/Countries/Norway.php new file mode 100644 index 00000000..c4d09737 --- /dev/null +++ b/src/Countries/Norway.php @@ -0,0 +1,43 @@ + '01-01', + 'Arbeidernes dag' => '05-01', + 'Grunnlovsdag' => '05-17', + 'Første juledag' => '12-25', + 'Andre juledag' => '12-26', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = CarbonImmutable::createFromTimestamp(easter_date($year)) + ->setTimezone('Europe/Oslo'); + + $holidays = [ + 'Skjærtorsdag' => $easter->subDays(3), + 'Langfredag' => $easter->subDays(2), + 'Første påskedag' => $easter, + 'Andre påskedag,' => $easter->addDay(), + 'Kristi Himmelfartsdag' => $easter->addDays(39), + 'Første pinsedag' => $easter->addDays(49), + 'Andre pinsedag' => $easter->addDays(50), + ]; + + return $holidays; + } +} diff --git a/tests/.pest/snapshots/Countries/NorwayTest/it_can_calculate_norwegian_holidays.snap b/tests/.pest/snapshots/Countries/NorwayTest/it_can_calculate_norwegian_holidays.snap new file mode 100644 index 00000000..d9dd9570 --- /dev/null +++ b/tests/.pest/snapshots/Countries/NorwayTest/it_can_calculate_norwegian_holidays.snap @@ -0,0 +1,50 @@ +[ + { + "name": "F\u00f8rste nytt\u00e5rsdag", + "date": "2024-01-01" + }, + { + "name": "Skj\u00e6rtorsdag", + "date": "2024-03-28" + }, + { + "name": "Langfredag", + "date": "2024-03-29" + }, + { + "name": "F\u00f8rste p\u00e5skedag", + "date": "2024-03-31" + }, + { + "name": "Andre p\u00e5skedag,", + "date": "2024-04-01" + }, + { + "name": "Arbeidernes dag", + "date": "2024-05-01" + }, + { + "name": "Kristi Himmelfartsdag", + "date": "2024-05-09" + }, + { + "name": "Grunnlovsdag", + "date": "2024-05-17" + }, + { + "name": "F\u00f8rste pinsedag", + "date": "2024-05-19" + }, + { + "name": "Andre pinsedag", + "date": "2024-05-20" + }, + { + "name": "F\u00f8rste juledag", + "date": "2024-12-25" + }, + { + "name": "Andre juledag", + "date": "2024-12-26" + } +] \ No newline at end of file diff --git a/tests/Countries/NorwayTest.php b/tests/Countries/NorwayTest.php new file mode 100644 index 00000000..b9a34276 --- /dev/null +++ b/tests/Countries/NorwayTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From 97125e76e045b62d7db0bef446895aaf713e91bc Mon Sep 17 00:00:00 2001 From: Stavros Date: Fri, 19 Jan 2024 02:29:45 +0200 Subject: [PATCH 13/66] Add Greece holidays --- src/Countries/Greece.php | 80 +++++++++++++++++++ .../it_can_calculate_hellenic_holidays.snap | 54 +++++++++++++ tests/Countries/GreeceTest.php | 18 +++++ 3 files changed, 152 insertions(+) create mode 100644 src/Countries/Greece.php create mode 100644 tests/.pest/snapshots/Countries/GreeceTest/it_can_calculate_hellenic_holidays.snap create mode 100644 tests/Countries/GreeceTest.php diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php new file mode 100644 index 00000000..14feef3b --- /dev/null +++ b/src/Countries/Greece.php @@ -0,0 +1,80 @@ + */ + protected function allHolidays(int $year): array + { + return array_merge([ + 'Πρωτοχρονιά' => '01-01', + 'Θεοφάνια' => '01-06', + '25η Μαρτίου' => '03-25', + 'Πρωτομαγιά' => '05-01', + 'Δεκαπενταύγουστος' => '08-15', + '28η Οκτωβρίου' => '10-28', + 'Χριστούγεννα' => '12-25', + 'Σύναξη της Θεοτόκου' => '12-26', + + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + + $orthodox_easter = CarbonImmutable::createFromTimestamp( + $this->calculateOrthodoxEaster($year) + )->setTimezone("Europe/Athens"); + + + $protomagia = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-05-01"); + + if ( + $protomagia == $orthodox_easter->subDays(2) || + $protomagia == $orthodox_easter->subDays(1) || + $protomagia == $orthodox_easter || + $protomagia == $orthodox_easter->addDay() + ) { + $protomagia = $orthodox_easter->addDays(2); + } + if ($protomagia->isSunday()) { + $protomagia = $protomagia->addDay(); + } + + return [ + 'Καθαρά Δευτέρα' => $orthodox_easter->subDays(48), //always Monday + 'Πρωτομαγιά' => $protomagia, + 'Μεγάλη Παρασκευή' => $orthodox_easter->subDays(2), + 'Κυριακή του Πάσχα' => $orthodox_easter, + 'Δευτέρα του Πάσχα' => $orthodox_easter->addDay(), + 'Αγίου Πνεύματος' => $orthodox_easter->addDays(50), //always Monday + ]; + } + + /** @return string */ + protected function calculateOrthodoxEaster(int $year) + { + $a = $year % 4; + $b = $year % 7; + $c = $year % 19; + $d = (19 * $c + 15) % 30; + $e = (2 * $a + 4 * $b - $d + 34) % 7; + $month = (int) (($d + $e + 114) / 31); + $day = (($d + $e + 114) % 31) + 1; + // julian to gregorian + $jtg = (int) ($year / 100) - (int) ($year / 400) - 2; + + $easterDate = mktime(0, 0, 0, $month, $day + $jtg, $year); + + return $easterDate; + } +} \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/GreeceTest/it_can_calculate_hellenic_holidays.snap b/tests/.pest/snapshots/Countries/GreeceTest/it_can_calculate_hellenic_holidays.snap new file mode 100644 index 00000000..14b2e6ab --- /dev/null +++ b/tests/.pest/snapshots/Countries/GreeceTest/it_can_calculate_hellenic_holidays.snap @@ -0,0 +1,54 @@ +[ + { + "name": "Πρωτοχρονιά", + "date": "2024-01-01" + }, + { + "name": "Θεοφάνια", + "date": "2024-01-06" + }, + { + "name": "Καθαρά Δευτέρα", + "date": "2024-03-18" + }, + { + "name": "25η Μαρτίου", + "date": "2024-03-25" + }, + { + "name": "Πρωτομαγιά", + "date": "2024-05-01" + }, + { + "name": "Μεγάλη Παρασκευή", + "date": "2024-05-03" + }, + { + "name": "Κυριακή του Πάσχα", + "date": "2024-05-05" + }, + { + "name": "Δευτέρα του Πάσχα", + "date": "2024-05-06" + }, + { + "name": "Αγίου Πνεύματος", + "date": "2024-06-24" + }, + { + "name": "Δεκαπενταύγουστος", + "date": "2024-08-15" + }, + { + "name": "28η Οκτωβρίου", + "date": "2024-10-28" + }, + { + "name": "Χριστούγεννα", + "date": "2024-12-25" + }, + { + "name": "Σύναξη της Θεοτόκου", + "date": "2024-12-26" + } +] \ No newline at end of file diff --git a/tests/Countries/GreeceTest.php b/tests/Countries/GreeceTest.php new file mode 100644 index 00000000..26805abb --- /dev/null +++ b/tests/Countries/GreeceTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From 3dfb792a0846e463fa07e7879619595c3fae5685 Mon Sep 17 00:00:00 2001 From: Stavros Date: Fri, 19 Jan 2024 13:32:03 +0200 Subject: [PATCH 14/66] Add Greece holidays - phpstan-baseline --- phpstan-baseline.neon | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 51b9330f..56b63c38 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -20,6 +20,26 @@ parameters: count: 1 path: src/Countries/Country.php + - + message: "#^Cannot call method addDay\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" + count: 1 + path: src/Countries/Greece.php + + - + message: "#^Cannot call method isSunday\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" + count: 1 + path: src/Countries/Greece.php + + - + message: "#^Method Spatie\\\\Holidays\\\\Countries\\\\Greece\\:\\:calculateOrthodoxEaster\\(\\) should return string but returns int\\|false\\.$#" + count: 1 + path: src/Countries/Greece.php + + - + message: "#^Method Spatie\\\\Holidays\\\\Countries\\\\Greece\\:\\:variableHolidays\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: src/Countries/Greece.php + - message: "#^Cannot call method isSunday\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" count: 1 From 81682ff5dfd8726171fca76b53a871d593bc075e Mon Sep 17 00:00:00 2001 From: Stavros Date: Fri, 19 Jan 2024 14:10:32 +0200 Subject: [PATCH 15/66] Add Greece holidays - phpstan-baseline - fix int --- phpstan-baseline.neon | 5 ----- src/Countries/Greece.php | 7 ++++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 56b63c38..0f6d531f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -30,11 +30,6 @@ parameters: count: 1 path: src/Countries/Greece.php - - - message: "#^Method Spatie\\\\Holidays\\\\Countries\\\\Greece\\:\\:calculateOrthodoxEaster\\(\\) should return string but returns int\\|false\\.$#" - count: 1 - path: src/Countries/Greece.php - - message: "#^Method Spatie\\\\Holidays\\\\Countries\\\\Greece\\:\\:variableHolidays\\(\\) should return array\\ but returns array\\\\.$#" count: 1 diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index 14feef3b..17e2a29f 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -60,8 +60,8 @@ protected function variableHolidays(int $year): array ]; } - /** @return string */ - protected function calculateOrthodoxEaster(int $year) + /** @return integer */ + protected function calculateOrthodoxEaster(int $year): int { $a = $year % 4; $b = $year % 7; @@ -75,6 +75,7 @@ protected function calculateOrthodoxEaster(int $year) $easterDate = mktime(0, 0, 0, $month, $day + $jtg, $year); - return $easterDate; + return (int) $easterDate; + } } \ No newline at end of file From 43f1e72592ac0a0aa7a54c12d5c1a4d8ddb7772c Mon Sep 17 00:00:00 2001 From: Stavros Date: Fri, 19 Jan 2024 14:47:51 +0200 Subject: [PATCH 16/66] fix pest --- .../it_can_calculate_hellenic_holidays.snap | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/.pest/snapshots/Countries/GreeceTest/it_can_calculate_hellenic_holidays.snap b/tests/.pest/snapshots/Countries/GreeceTest/it_can_calculate_hellenic_holidays.snap index 14b2e6ab..00c8075c 100644 --- a/tests/.pest/snapshots/Countries/GreeceTest/it_can_calculate_hellenic_holidays.snap +++ b/tests/.pest/snapshots/Countries/GreeceTest/it_can_calculate_hellenic_holidays.snap @@ -1,54 +1,54 @@ [ { - "name": "Πρωτοχρονιά", + "name": "\u03a0\u03c1\u03c9\u03c4\u03bf\u03c7\u03c1\u03bf\u03bd\u03b9\u03ac", "date": "2024-01-01" }, { - "name": "Θεοφάνια", + "name": "\u0398\u03b5\u03bf\u03c6\u03ac\u03bd\u03b9\u03b1", "date": "2024-01-06" }, { - "name": "Καθαρά Δευτέρα", + "name": "\u039a\u03b1\u03b8\u03b1\u03c1\u03ac \u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1", "date": "2024-03-18" }, { - "name": "25η Μαρτίου", + "name": "25\u03b7 \u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5", "date": "2024-03-25" }, { - "name": "Πρωτομαγιά", + "name": "\u03a0\u03c1\u03c9\u03c4\u03bf\u03bc\u03b1\u03b3\u03b9\u03ac", "date": "2024-05-01" }, { - "name": "Μεγάλη Παρασκευή", + "name": "\u039c\u03b5\u03b3\u03ac\u03bb\u03b7 \u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae", "date": "2024-05-03" }, { - "name": "Κυριακή του Πάσχα", + "name": "\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae \u03c4\u03bf\u03c5 \u03a0\u03ac\u03c3\u03c7\u03b1", "date": "2024-05-05" }, { - "name": "Δευτέρα του Πάσχα", + "name": "\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1 \u03c4\u03bf\u03c5 \u03a0\u03ac\u03c3\u03c7\u03b1", "date": "2024-05-06" }, { - "name": "Αγίου Πνεύματος", + "name": "\u0391\u03b3\u03af\u03bf\u03c5 \u03a0\u03bd\u03b5\u03cd\u03bc\u03b1\u03c4\u03bf\u03c2", "date": "2024-06-24" }, { - "name": "Δεκαπενταύγουστος", + "name": "\u0394\u03b5\u03ba\u03b1\u03c0\u03b5\u03bd\u03c4\u03b1\u03cd\u03b3\u03bf\u03c5\u03c3\u03c4\u03bf\u03c2", "date": "2024-08-15" }, { - "name": "28η Οκτωβρίου", + "name": "28\u03b7 \u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5", "date": "2024-10-28" }, { - "name": "Χριστούγεννα", + "name": "\u03a7\u03c1\u03b9\u03c3\u03c4\u03bf\u03cd\u03b3\u03b5\u03bd\u03bd\u03b1", "date": "2024-12-25" }, { - "name": "Σύναξη της Θεοτόκου", + "name": "\u03a3\u03cd\u03bd\u03b1\u03be\u03b7 \u03c4\u03b7\u03c2 \u0398\u03b5\u03bf\u03c4\u03cc\u03ba\u03bf\u03c5", "date": "2024-12-26" } ] \ No newline at end of file From 0d0867b98e3ee905101a0106edb66915020a070d Mon Sep 17 00:00:00 2001 From: Amit Samtani Date: Fri, 19 Jan 2024 15:14:05 -0500 Subject: [PATCH 17/66] Add Panama Holidays --- src/Countries/Panama.php | 75 +++++++++++++++++ .../it_can_calculate_panama_holidays.snap | 82 +++++++++++++++++++ tests/Countries/PanamaTest.php | 18 ++++ 3 files changed, 175 insertions(+) create mode 100644 src/Countries/Panama.php create mode 100644 tests/.pest/snapshots/Countries/PanamaTest/it_can_calculate_panama_holidays.snap create mode 100644 tests/Countries/PanamaTest.php diff --git a/src/Countries/Panama.php b/src/Countries/Panama.php new file mode 100644 index 00000000..b88ccb96 --- /dev/null +++ b/src/Countries/Panama.php @@ -0,0 +1,75 @@ + '01-01', + 'Día de los Mártires' => '01-09', + 'Día del Trabajador' => '05-01', + 'Separación de Panamá de Colombia' => '11-03', + 'Día de los Símbolos Patrios' => '11-04', + 'Día de Consolidación de la Separación de Panamá con Colombia en Colón' => '11-05', + 'Grito de la Independencia' => '11-10', + 'Independencia de Panamá de España' => '11-28', + 'Día de las Madres' => '12-08', + 'Día de los Caídos por la invasión de Estados Unidos a Panamá' => '12-20', + 'Navidad' => '12-25', + ]; + + return array_merge( + $fixedHolidays, + $this->puentes($fixedHolidays, $year), + $this->variableHolidays($year) + ); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = $this->easter($year); + + return [ + 'Carnaval (Día 1)' => $easter->subDays(50), + 'Carnaval (Día 2)' => $easter->subDays(49), + 'Carnaval (Día 3)' => $easter->subDays(48), + 'Carnaval (Día 4)' => $easter->subDays(47), + 'Jueves Santo' => $easter->subDays(3), + 'Viernes Santo' => $easter->subDays(2), + ]; + } + + /** + * @param array $fixedHolidays Array of holidays in the format ['holiday name' => 'mm-dd'] + * @param int $year The year for which to calculate the holidays + * @return array + */ + protected function puentes(array $fixedHolidays, int $year): array + { + $holidays = []; + + foreach ($fixedHolidays as $name => $date) { + $holiday = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-{$date}"); + + if ($holiday !== false) { + $holidays[$name] = $holiday; + if ($holiday->isSunday()) { + $holidays[$name . ' (Puente)'] = $holiday->addDay(); + } + } + } + + return $holidays; + } + +} diff --git a/tests/.pest/snapshots/Countries/PanamaTest/it_can_calculate_panama_holidays.snap b/tests/.pest/snapshots/Countries/PanamaTest/it_can_calculate_panama_holidays.snap new file mode 100644 index 00000000..b3231862 --- /dev/null +++ b/tests/.pest/snapshots/Countries/PanamaTest/it_can_calculate_panama_holidays.snap @@ -0,0 +1,82 @@ +[ + { + "name": "A\u00f1o Nuevo", + "date": "2024-01-01" + }, + { + "name": "D\u00eda de los M\u00e1rtires", + "date": "2024-01-09" + }, + { + "name": "Carnaval (D\u00eda 1)", + "date": "2024-02-10" + }, + { + "name": "Carnaval (D\u00eda 2)", + "date": "2024-02-11" + }, + { + "name": "Carnaval (D\u00eda 3)", + "date": "2024-02-12" + }, + { + "name": "Carnaval (D\u00eda 4)", + "date": "2024-02-13" + }, + { + "name": "Jueves Santo", + "date": "2024-03-28" + }, + { + "name": "Viernes Santo", + "date": "2024-03-29" + }, + { + "name": "D\u00eda del Trabajador", + "date": "2024-05-01" + }, + { + "name": "Separaci\u00f3n de Panam\u00e1 de Colombia", + "date": "2024-11-03" + }, + { + "name": "D\u00eda de los S\u00edmbolos Patrios", + "date": "2024-11-04" + }, + { + "name": "Separaci\u00f3n de Panam\u00e1 de Colombia (Puente)", + "date": "2024-11-04" + }, + { + "name": "D\u00eda de Consolidaci\u00f3n de la Separaci\u00f3n de Panam\u00e1 con Colombia en Col\u00f3n", + "date": "2024-11-05" + }, + { + "name": "Grito de la Independencia", + "date": "2024-11-10" + }, + { + "name": "Grito de la Independencia (Puente)", + "date": "2024-11-11" + }, + { + "name": "Independencia de Panam\u00e1 de Espa\u00f1a", + "date": "2024-11-28" + }, + { + "name": "D\u00eda de las Madres", + "date": "2024-12-08" + }, + { + "name": "D\u00eda de las Madres (Puente)", + "date": "2024-12-09" + }, + { + "name": "D\u00eda de los Ca\u00eddos por la invasi\u00f3n de Estados Unidos a Panam\u00e1", + "date": "2024-12-20" + }, + { + "name": "Navidad", + "date": "2024-12-25" + } +] \ No newline at end of file diff --git a/tests/Countries/PanamaTest.php b/tests/Countries/PanamaTest.php new file mode 100644 index 00000000..f848a26f --- /dev/null +++ b/tests/Countries/PanamaTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From ae7232bf81a5544bfa6ce41f82bf4e60a8087735 Mon Sep 17 00:00:00 2001 From: Amit Samtani Date: Fri, 19 Jan 2024 15:26:50 -0500 Subject: [PATCH 18/66] Add Panama Holidays --- src/Countries/Panama.php | 1 + .../PanamaTest/it_can_calculate_panama_holidays.snap | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/Countries/Panama.php b/src/Countries/Panama.php index b88ccb96..8e135b07 100644 --- a/src/Countries/Panama.php +++ b/src/Countries/Panama.php @@ -46,6 +46,7 @@ protected function variableHolidays(int $year): array 'Carnaval (Día 4)' => $easter->subDays(47), 'Jueves Santo' => $easter->subDays(3), 'Viernes Santo' => $easter->subDays(2), + 'Sábado de Gloria' => $easter->subDays(1), ]; } diff --git a/tests/.pest/snapshots/Countries/PanamaTest/it_can_calculate_panama_holidays.snap b/tests/.pest/snapshots/Countries/PanamaTest/it_can_calculate_panama_holidays.snap index b3231862..cbe9ce88 100644 --- a/tests/.pest/snapshots/Countries/PanamaTest/it_can_calculate_panama_holidays.snap +++ b/tests/.pest/snapshots/Countries/PanamaTest/it_can_calculate_panama_holidays.snap @@ -31,6 +31,10 @@ "name": "Viernes Santo", "date": "2024-03-29" }, + { + "name": "S\u00e1bado de Gloria", + "date": "2024-03-30" + }, { "name": "D\u00eda del Trabajador", "date": "2024-05-01" From 876005a586c42217171bb32706c10eed35f5eaee Mon Sep 17 00:00:00 2001 From: Amit Samtani Date: Sat, 20 Jan 2024 07:57:36 -0500 Subject: [PATCH 19/66] Add sources on where we got the holidays. Rename puentes to calculateBridgeDays to keep everything in English. --- src/Countries/Panama.php | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/Countries/Panama.php b/src/Countries/Panama.php index 8e135b07..04f3c54d 100644 --- a/src/Countries/Panama.php +++ b/src/Countries/Panama.php @@ -11,6 +11,9 @@ public function countryCode(): string return 'pa'; } + /* + * Source: https://www.telemetro.com/nacionales/calendario-feriados-panama-2024-todos-los-dias-no-laborables-y-festivos-n5953115 + */ protected function allHolidays(int $year): array { $fixedHolidays = [ @@ -29,8 +32,8 @@ protected function allHolidays(int $year): array return array_merge( $fixedHolidays, - $this->puentes($fixedHolidays, $year), - $this->variableHolidays($year) + $this->variableHolidays($year), + $this->calculateBridgeDays($fixedHolidays, $year), ); } @@ -51,11 +54,26 @@ protected function variableHolidays(int $year): array } /** + * Calculate bridge days for holidays that fall on a Sunday. + * In Panama, these are called "puentes" + * + * Source: https://www.telemetro.com/nacionales/calendario-dias-libres-panama-este-2023-n5825178 + * + * Spanish: + * "Según el artículo 47 del código de trabajo un día es considerado puente cuando la fecha + * establecida para una celebración nacional coincida con un día domingo, el lunes siguiente + * se habilitará como día de descanso semanal obligatorio" + * + * English Translation: + * "According to article 47 of the labor code, a day is considered a bridge when the date + * established for a national celebration to coincide with a Sunday, the following Monday + * will be enabled as a mandatory weekly rest day" + * * @param array $fixedHolidays Array of holidays in the format ['holiday name' => 'mm-dd'] * @param int $year The year for which to calculate the holidays * @return array */ - protected function puentes(array $fixedHolidays, int $year): array + protected function calculateBridgeDays(array $fixedHolidays, int $year): array { $holidays = []; @@ -72,5 +90,4 @@ protected function puentes(array $fixedHolidays, int $year): array return $holidays; } - } From d12bcb4a40a027e2fc8f5468f24b00f8a82a5634 Mon Sep 17 00:00:00 2001 From: thecaliskan Date: Sat, 20 Jan 2024 20:34:35 +0300 Subject: [PATCH 20/66] Added Islamic holidays --- src/Countries/Turkey.php | 275 +++++++++++++++++- .../it_can_calculate_turkey_holidays.snap | 34 --- ...olidays_with_data_set___1970____1970_.snap | 70 +++++ ...olidays_with_data_set___1973____1973_.snap | 70 +++++ ...olidays_with_data_set___1974____1974_.snap | 70 +++++ ...olidays_with_data_set___1975____1975_.snap | 70 +++++ ...olidays_with_data_set___1999____1999_.snap | 70 +++++ ...olidays_with_data_set___2000____2000_.snap | 70 +++++ ...olidays_with_data_set___2001____2001_.snap | 70 +++++ ...olidays_with_data_set___2005____2005_.snap | 70 +++++ ...olidays_with_data_set___2006____2006_.snap | 70 +++++ ...olidays_with_data_set___2007____2007_.snap | 70 +++++ ...olidays_with_data_set___2008____2008_.snap | 70 +++++ ...olidays_with_data_set___2009____2009_.snap | 70 +++++ ...olidays_with_data_set___2016____2016_.snap | 70 +++++ ...olidays_with_data_set___2017____2017_.snap | 70 +++++ ...olidays_with_data_set___2021____2021_.snap | 70 +++++ ...olidays_with_data_set___2022____2022_.snap | 70 +++++ ...olidays_with_data_set___2023____2023_.snap | 70 +++++ ...olidays_with_data_set___2024____2024_.snap | 70 +++++ ...olidays_with_data_set___2025____2025_.snap | 70 +++++ ...olidays_with_data_set___2032____2032_.snap | 70 +++++ ...olidays_with_data_set___2033____2033_.snap | 70 +++++ ...olidays_with_data_set___2034____2034_.snap | 70 +++++ ...olidays_with_data_set___2037____2037_.snap | 70 +++++ tests/Countries/TurkeyTest.php | 2 +- 26 files changed, 1879 insertions(+), 42 deletions(-) delete mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1970____1970_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1973____1973_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1974____1974_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1975____1975_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1999____1999_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2000____2000_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2001____2001_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2005____2005_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2006____2006_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2007____2007_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2008____2008_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2009____2009_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2016____2016_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2017____2017_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2021____2021_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2022____2022_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2023____2023_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2024____2024_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2025____2025_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2032____2032_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2033____2033_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2034____2034_.snap create mode 100644 tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2037____2037_.snap diff --git a/src/Countries/Turkey.php b/src/Countries/Turkey.php index 58b6c13a..698b7853 100644 --- a/src/Countries/Turkey.php +++ b/src/Countries/Turkey.php @@ -6,6 +6,169 @@ class Turkey extends Country { + /** + * No library or built-in php intl functions convert dates properly for all years or all country including + * “geniusts/hijri-dates”. It is most logical to prepare the dates between 1970 and 1938 as a constant property + * for Islamic holidays. Because Islamic holidays predicted and actual dates may change until the last moment. + * Since the information on wikipedia is incorrect, it was obtained by searching the old calendar + * on Google Images for each year. The accuracy of the information has been double checked. + * Ramadan and Eid al-Adha vary for Turkey and other countries. + * A converter algorithm that will cover all years does not seem possible. + */ + public const ramadanHolidays = [ + 1970 => '12-01', + 1971 => '11-20', + 1972 => '11-08', + 1973 => '10-28', + 1974 => '10-17', + 1975 => '10-06', + 1976 => '09-25', + 1977 => '09-15', + 1978 => '09-04', + 1979 => '08-24', + 1980 => '08-12', + 1981 => '08-01', + 1982 => '07-22', + 1983 => '07-12', + 1984 => '06-30', + 1985 => '06-20', + 1986 => '06-09', + 1987 => '05-29', + 1988 => '05-17', + 1989 => '05-06', + 1990 => '04-26', + 1991 => '04-16', + 1992 => '04-04', + 1993 => '03-24', + 1994 => '03-13', + 1995 => '03-03', + 1996 => '02-20', + 1997 => '02-09', + 1998 => '01-29', + 1999 => '01-19', + 2000 => [ + '01-08', + '12-27', + ], + 2001 => '12-16', + 2002 => '12-05', + 2003 => '11-25', + 2004 => '11-14', + 2005 => '11-03', + 2006 => '10-23', + 2007 => '10-12', + 2008 => '09-30', + 2009 => '09-20', + 2010 => '09-09', + 2011 => '08-30', + 2012 => '08-19', + 2013 => '08-08', + 2014 => '07-28', + 2015 => '07-17', + 2016 => '07-05', + 2017 => '06-25', + 2018 => '06-15', + 2019 => '06-04', + 2020 => '05-24', + 2021 => '05-13', + 2022 => '05-02', + 2023 => '04-21', + 2024 => '04-10', + 2025 => '04-30', + 2026 => '03-20', + 2027 => '03-09', + 2028 => '02-26', + 2029 => '02-14', + 2030 => '02-03', + 2031 => '01-24', + 2032 => '01-14', + 2033 => [ + '01-02', + '12-23', + ], + 2034 => '12-11', + 2035 => '12-01', + 2036 => '11-19', + 2037 => '11-09', + ]; + + public const sacrificeHolidays = [ + 1970 => '02-17', + 1971 => '02-16', + 1972 => '01-27', + 1973 => '01-15', + 1974 => [ + '01-04', + '12-24', + ], + 1975 => '12-13', + 1976 => '12-02', + 1977 => '11-22', + 1978 => '11-11', + 1979 => '10-31', + 1980 => '10-19', + 1981 => '10-08', + 1982 => '09-27', + 1983 => '09-17', + 1984 => '09-06', + 1985 => '08-26', + 1986 => '08-16', + 1987 => '08-05', + 1988 => '07-24', + 1989 => '07-13', + 1990 => '07-03', + 1991 => '06-23', + 1992 => '06-11', + 1993 => '06-01', + 1994 => '05-21', + 1995 => '05-10', + 1996 => '04-28', + 1997 => '04-18', + 1998 => '04-07', + 1999 => '03-28', + 2000 => '03-16', + 2001 => '03-05', + 2002 => '02-22', + 2003 => '02-11', + 2004 => '02-01', + 2005 => '01-20', + 2006 => [ + '01-10', + '12-31', + ], + 2007 => '12-20', + 2008 => '12-08', + 2009 => '11-27', + 2010 => '11-16', + 2011 => '11-06', + 2012 => '10-25', + 2013 => '10-15', + 2014 => '10-04', + 2015 => '09-23', + 2016 => '09-12', + 2017 => '09-01', + 2018 => '08-21', + 2019 => '08-11', + 2020 => '07-31', + 2021 => '07-20', + 2022 => '07-09', + 2023 => '06-28', + 2024 => '06-16', + 2025 => '06-06', + 2026 => '05-26', + 2027 => '05-16', + 2028 => '05-04', + 2029 => '04-23', + 2030 => '04-13', + 2031 => '04-02', + 2032 => '03-21', + 2033 => '03-11', + 2034 => '02-28', + 2035 => '02-17', + 2036 => '02-07', + 2037 => '01-26', + ]; + public function countryCode(): string { return 'tr'; @@ -13,24 +176,122 @@ public function countryCode(): string protected function allHolidays(int $year): array { + $newHolidays = []; + + if ($year >= 2009) { + $newHolidays['Emek ve Dayanışma Günü'] = '05-01'; + } + + if ($year >= 2017) { + $newHolidays['Demokrasi ve Millî Birlik Günü'] = '07-15'; + } + return array_merge([ 'Yılbaşı' => '01-01', 'Ulusal Egemenlik ve Çocuk Bayramı' => '04-23', - 'Emek ve Dayanışma Günü' => '05-01', 'Atatürk\'ü Anma, Gençlik ve Spor Bayramı' => '05-19', - 'Demokrasi ve Millî Birlik Günü' => '07-15', 'Zafer Bayramı' => '08-30', 'Cumhuriyet Bayramı Arifesi' => '10-28', 'Cumhuriyet Bayramı' => '10-29', - ], $this->variableHolidays($year)); + ], $newHolidays, $this->variableHolidays($year)); } /** @return array */ protected function variableHolidays(int $year): array { - return [ - //It will be implemented after Islamic holidays. Because Islamic holidays are lunar based. - //https://github.com/spatie/holidays/discussions/79 - ]; + return array_merge([ + + ], $this->getIslamicHolidays( + year: $year, + holidays: self::ramadanHolidays, + label: 'Ramazan Bayramı', + day: 3 + ), $this->getIslamicHolidays( + year: $year, + holidays: self::sacrificeHolidays, + label: 'Kurban Bayramı', + day: 4 + )); + } + + /** + * @param array> $holidays + * @return array + */ + protected function getIslamicHolidays( + int $year, + array $holidays, + string $label, + int $day, + ): array { + $islamicHolidays = []; + $counter = 0; + + if ($year != 1970) { + $previousHoliday = is_array($holidays[$year - 1]) ? $holidays[$year - 1][1] : $holidays[$year - 1]; + + $previousHoliday = CarbonImmutable::createFromFormat('Y-m-d', ($year - 1).'-'.$previousHoliday); + + if ($previousHoliday->addDays($day - 1)->year == $year) { + $islamicHolidays = $this->prepareHolidays( + holiday: $previousHoliday, + day: $day, + label: $label, + filterYear: $year + ); + $counter++; + } + } + + $currentYearHolidays = is_array($holidays[$year]) ? $holidays[$year] : [$holidays[$year]]; + + foreach ($currentYearHolidays as $currentYearHoliday) { + $currentYearHoliday = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-{$currentYearHoliday}"); + + $islamicHolidays = array_merge($islamicHolidays, $this->prepareHolidays( + holiday: $currentYearHoliday, + day: $day, + label: $label, + filterYear: $year, + prefix: $counter ? ($counter + 1).'. ' : '' + )); + $counter++; + } + + if ($year != 2037) { + $nextHoliday = is_array($holidays[$year + 1]) ? $holidays[$year + 1][1] : $holidays[$year + 1]; + + $nextHoliday = CarbonImmutable::createFromFormat('Y-m-d', ($year + 1).'-'.$nextHoliday); + + if ($nextHoliday->addDays(-1)->year == $year) { + $islamicHolidays = array_merge($islamicHolidays, $this->prepareHolidays( + holiday: $nextHoliday, + day: $day, + label: $label, + filterYear: $year, + prefix: $counter ? ($counter + 1).'. ' : '' + )); + } + } + + return $islamicHolidays; + } + + /** @return array */ + protected function prepareHolidays( + CarbonImmutable $holiday, + int $day, + string $label, + int $filterYear, + string $prefix = '' + ): array { + $holidays = []; + + $holidays[$prefix.$label.' Arifesi'] = $holiday->addDays(-1); + foreach (range(1, $day) as $range) { + $holidays[$prefix.$label.' '.$range.'. Gün'] = $holiday->addDays($range - 1); + } + + return array_filter($holidays, fn ($holiday) => $holiday->year == $filterYear); } } diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap deleted file mode 100644 index e7826692..00000000 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays.snap +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" - }, - { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" - }, - { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" - }, - { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" - }, - { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" - }, - { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" - }, - { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" - }, - { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" - } -] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1970____1970_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1970____1970_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1970____1970_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1973____1973_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1973____1973_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1973____1973_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1974____1974_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1974____1974_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1974____1974_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1975____1975_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1975____1975_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1975____1975_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1999____1999_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1999____1999_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1999____1999_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2000____2000_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2000____2000_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2000____2000_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2001____2001_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2001____2001_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2001____2001_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2005____2005_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2005____2005_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2005____2005_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2006____2006_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2006____2006_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2006____2006_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2007____2007_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2007____2007_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2007____2007_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2008____2008_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2008____2008_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2008____2008_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2009____2009_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2009____2009_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2009____2009_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2016____2016_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2016____2016_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2016____2016_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2017____2017_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2017____2017_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2017____2017_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2021____2021_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2021____2021_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2021____2021_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2022____2022_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2022____2022_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2022____2022_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2023____2023_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2023____2023_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2023____2023_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2024____2024_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2024____2024_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2024____2024_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2025____2025_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2025____2025_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2025____2025_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2032____2032_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2032____2032_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2032____2032_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2033____2033_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2033____2033_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2033____2033_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2034____2034_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2034____2034_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2034____2034_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2037____2037_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2037____2037_.snap new file mode 100644 index 00000000..14d82b72 --- /dev/null +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2037____2037_.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Y\u0131lba\u015f\u0131", + "date": "2024-01-01" + }, + { + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2024-04-09" + }, + { + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2024-04-10" + }, + { + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2024-04-11" + }, + { + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2024-04-12" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2024-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2024-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2024-05-19" + }, + { + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2024-06-15" + }, + { + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2024-06-16" + }, + { + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2024-06-17" + }, + { + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2024-06-18" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2024-06-19" + }, + { + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2024-07-15" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2024-08-30" + }, + { + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2024-10-28" + }, + { + "name": "Cumhuriyet Bayram\u0131", + "date": "2024-10-29" + } +] \ No newline at end of file diff --git a/tests/Countries/TurkeyTest.php b/tests/Countries/TurkeyTest.php index 7265a31f..7579c764 100644 --- a/tests/Countries/TurkeyTest.php +++ b/tests/Countries/TurkeyTest.php @@ -15,4 +15,4 @@ ->not()->toBeEmpty(); expect(formatDates($holidays))->toMatchSnapshot(); -}); +})->with([1970, 1973, 1974, 1975, 1999, 2000, 2001, 2005, 2006, 2007, 2008, 2009, 2016, 2017, 2021, 2022, 2023, 2024, 2025, 2032, 2033, 2034, 2037]); From 7e0e1181487254758b19debec5f47638fb1fabc8 Mon Sep 17 00:00:00 2001 From: thecaliskan Date: Sat, 20 Jan 2024 20:40:55 +0300 Subject: [PATCH 21/66] Added Islamic holidays --- ...olidays_with_data_set___1970____1970_.snap | 64 +++++++--------- ...olidays_with_data_set___1973____1973_.snap | 64 +++++++--------- ...olidays_with_data_set___1974____1974_.snap | 76 +++++++++++-------- ...olidays_with_data_set___1975____1975_.snap | 60 +++++++-------- ...olidays_with_data_set___1999____1999_.snap | 46 +++++------ ...olidays_with_data_set___2000____2000_.snap | 62 ++++++++------- ...olidays_with_data_set___2001____2001_.snap | 64 +++++++--------- ...olidays_with_data_set___2005____2005_.snap | 64 +++++++--------- ...olidays_with_data_set___2006____2006_.snap | 64 ++++++++-------- ...olidays_with_data_set___2007____2007_.snap | 70 +++++++++-------- ...olidays_with_data_set___2008____2008_.snap | 60 +++++++-------- ...olidays_with_data_set___2009____2009_.snap | 64 ++++++++-------- ...olidays_with_data_set___2016____2016_.snap | 56 +++++++------- ...olidays_with_data_set___2017____2017_.snap | 56 +++++++------- ...olidays_with_data_set___2021____2021_.snap | 50 ++++++------ ...olidays_with_data_set___2022____2022_.snap | 46 +++++------ ...olidays_with_data_set___2023____2023_.snap | 38 +++++----- ...olidays_with_data_set___2025____2025_.snap | 46 +++++------ ...olidays_with_data_set___2032____2032_.snap | 50 ++++++------ ...olidays_with_data_set___2033____2033_.snap | 66 ++++++++++------ ...olidays_with_data_set___2034____2034_.snap | 64 ++++++++-------- ...olidays_with_data_set___2037____2037_.snap | 64 ++++++++-------- tests/Countries/TurkeyTest.php | 4 +- 23 files changed, 637 insertions(+), 661 deletions(-) diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1970____1970_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1970____1970_.snap index 14d82b72..34cfe306 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1970____1970_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1970____1970_.snap @@ -1,70 +1,62 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "1970-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Kurban Bayram\u0131 Arifesi", + "date": "1970-02-16" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "1970-02-17" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "1970-02-18" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "1970-02-19" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "1970-02-20" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "1970-04-23" }, { "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" - }, - { - "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" - }, - { - "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "1970-05-19" }, { - "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "name": "Zafer Bayram\u0131", + "date": "1970-08-30" }, { - "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "1970-10-28" }, { - "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "name": "Cumhuriyet Bayram\u0131", + "date": "1970-10-29" }, { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "1970-11-30" }, { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "1970-12-01" }, { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "1970-12-02" }, { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "1970-12-03" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1973____1973_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1973____1973_.snap index 14d82b72..2239623a 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1973____1973_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1973____1973_.snap @@ -1,70 +1,62 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "1973-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Kurban Bayram\u0131 Arifesi", + "date": "1973-01-14" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "1973-01-15" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "1973-01-16" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "1973-01-17" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "1973-01-18" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "1973-04-23" }, { "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" - }, - { - "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" - }, - { - "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "1973-05-19" }, { - "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "name": "Zafer Bayram\u0131", + "date": "1973-08-30" }, { - "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "1973-10-27" }, { - "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "1973-10-28" }, { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "1973-10-28" }, { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "name": "Cumhuriyet Bayram\u0131", + "date": "1973-10-29" }, { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "1973-10-29" }, { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "1973-10-30" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1974____1974_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1974____1974_.snap index 14d82b72..1e862b48 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1974____1974_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1974____1974_.snap @@ -1,70 +1,82 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "1974-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Kurban Bayram\u0131 Arifesi", + "date": "1974-01-03" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "1974-01-04" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "1974-01-05" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "1974-01-06" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "1974-01-07" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "1974-04-23" }, { "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "date": "1974-05-19" }, { - "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "name": "Zafer Bayram\u0131", + "date": "1974-08-30" }, { - "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "1974-10-16" }, { - "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "1974-10-17" }, { - "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "1974-10-18" }, { - "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "1974-10-19" }, { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "1974-10-28" }, { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "name": "Cumhuriyet Bayram\u0131", + "date": "1974-10-29" }, { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "name": "2. Kurban Bayram\u0131 Arifesi", + "date": "1974-12-23" }, { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "name": "2. Kurban Bayram\u0131 1. G\u00fcn", + "date": "1974-12-24" + }, + { + "name": "2. Kurban Bayram\u0131 2. G\u00fcn", + "date": "1974-12-25" + }, + { + "name": "2. Kurban Bayram\u0131 3. G\u00fcn", + "date": "1974-12-26" + }, + { + "name": "2. Kurban Bayram\u0131 4. G\u00fcn", + "date": "1974-12-27" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1975____1975_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1975____1975_.snap index 14d82b72..f7e4e630 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1975____1975_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1975____1975_.snap @@ -1,70 +1,62 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "1975-01-01" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "1975-04-23" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "1975-05-19" + }, + { + "name": "Zafer Bayram\u0131", + "date": "1975-08-30" }, { "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "date": "1975-10-05" }, { "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "date": "1975-10-06" }, { "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "date": "1975-10-07" }, { "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" - }, - { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "date": "1975-10-08" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "1975-10-28" }, { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "name": "Cumhuriyet Bayram\u0131", + "date": "1975-10-29" }, { "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "date": "1975-12-12" }, { "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "1975-12-13" }, { "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "date": "1975-12-14" }, { "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "date": "1975-12-15" }, { "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" - }, - { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" - }, - { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" - }, - { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" - }, - { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "1975-12-16" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1999____1999_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1999____1999_.snap index 14d82b72..d97fb437 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1999____1999_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___1999____1999_.snap @@ -1,70 +1,62 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "1999-01-01" }, { "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "date": "1999-01-18" }, { "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "date": "1999-01-19" }, { "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "date": "1999-01-20" }, { "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" - }, - { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" - }, - { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" - }, - { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "date": "1999-01-21" }, { "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "date": "1999-03-27" }, { "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "1999-03-28" }, { "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "date": "1999-03-29" }, { "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "date": "1999-03-30" }, { "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "date": "1999-03-31" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "1999-04-23" }, { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "1999-05-19" }, { "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "date": "1999-08-30" }, { "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "date": "1999-10-28" }, { "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "1999-10-29" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2000____2000_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2000____2000_.snap index 14d82b72..81ec8002 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2000____2000_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2000____2000_.snap @@ -1,70 +1,78 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2000-01-01" }, { "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "date": "2000-01-07" }, { "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "date": "2000-01-08" }, { "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "date": "2000-01-09" }, { "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" - }, - { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" - }, - { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" - }, - { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "date": "2000-01-10" }, { "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "date": "2000-03-15" }, { "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "2000-03-16" }, { "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "date": "2000-03-17" }, { "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "date": "2000-03-18" }, { "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "date": "2000-03-19" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2000-04-23" }, { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2000-05-19" }, { "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "date": "2000-08-30" }, { "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "date": "2000-10-28" }, { "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "2000-10-29" + }, + { + "name": "2. Ramazan Bayram\u0131 Arifesi", + "date": "2000-12-26" + }, + { + "name": "2. Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2000-12-27" + }, + { + "name": "2. Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2000-12-28" + }, + { + "name": "2. Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2000-12-29" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2001____2001_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2001____2001_.snap index 14d82b72..85bacf31 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2001____2001_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2001____2001_.snap @@ -1,70 +1,62 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2001-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2001-03-04" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2001-03-05" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2001-03-06" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2001-03-07" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2001-03-08" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2001-04-23" }, { "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" - }, - { - "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" - }, - { - "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "2001-05-19" }, { - "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "name": "Zafer Bayram\u0131", + "date": "2001-08-30" }, { - "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2001-10-28" }, { - "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "name": "Cumhuriyet Bayram\u0131", + "date": "2001-10-29" }, { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2001-12-15" }, { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2001-12-16" }, { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2001-12-17" }, { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2001-12-18" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2005____2005_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2005____2005_.snap index 14d82b72..7de07e71 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2005____2005_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2005____2005_.snap @@ -1,70 +1,62 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2005-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2005-01-19" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2005-01-20" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2005-01-21" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2005-01-22" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2005-01-23" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2005-04-23" }, { "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" - }, - { - "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" - }, - { - "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "2005-05-19" }, { - "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "name": "Zafer Bayram\u0131", + "date": "2005-08-30" }, { - "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2005-10-28" }, { - "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "name": "Cumhuriyet Bayram\u0131", + "date": "2005-10-29" }, { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2005-11-02" }, { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2005-11-03" }, { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2005-11-04" }, { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2005-11-05" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2006____2006_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2006____2006_.snap index 14d82b72..4f181ced 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2006____2006_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2006____2006_.snap @@ -1,70 +1,70 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2006-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2006-01-09" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2006-01-10" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2006-01-11" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2006-01-12" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2006-01-13" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2006-04-23" }, { "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "date": "2006-05-19" }, { - "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "name": "Zafer Bayram\u0131", + "date": "2006-08-30" }, { - "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2006-10-22" }, { - "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2006-10-23" }, { - "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2006-10-24" }, { - "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2006-10-25" }, { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2006-10-28" }, { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "name": "Cumhuriyet Bayram\u0131", + "date": "2006-10-29" }, { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "name": "2. Kurban Bayram\u0131 Arifesi", + "date": "2006-12-30" }, { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "name": "2. Kurban Bayram\u0131 1. G\u00fcn", + "date": "2006-12-31" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2007____2007_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2007____2007_.snap index 14d82b72..7ec5ca96 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2007____2007_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2007____2007_.snap @@ -1,70 +1,74 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2007-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2007-01-01" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2007-01-02" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2007-01-03" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2007-04-23" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2007-05-19" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Zafer Bayram\u0131", + "date": "2007-08-30" }, { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2007-10-11" }, { - "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2007-10-12" }, { - "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2007-10-13" }, { - "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2007-10-14" }, { - "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2007-10-28" }, { - "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "name": "Cumhuriyet Bayram\u0131", + "date": "2007-10-29" }, { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "name": "2. Kurban Bayram\u0131 Arifesi", + "date": "2007-12-19" }, { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "name": "2. Kurban Bayram\u0131 1. G\u00fcn", + "date": "2007-12-20" }, { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "name": "2. Kurban Bayram\u0131 2. G\u00fcn", + "date": "2007-12-21" }, { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "name": "2. Kurban Bayram\u0131 3. G\u00fcn", + "date": "2007-12-22" + }, + { + "name": "2. Kurban Bayram\u0131 4. G\u00fcn", + "date": "2007-12-23" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2008____2008_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2008____2008_.snap index 14d82b72..4735e391 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2008____2008_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2008____2008_.snap @@ -1,70 +1,62 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2008-01-01" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2008-04-23" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2008-05-19" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2008-08-30" }, { "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "date": "2008-09-29" }, { "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "date": "2008-09-30" }, { "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "date": "2008-10-01" }, { "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" - }, - { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "date": "2008-10-02" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2008-10-28" }, { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "name": "Cumhuriyet Bayram\u0131", + "date": "2008-10-29" }, { "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "date": "2008-12-07" }, { "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "2008-12-08" }, { "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "date": "2008-12-09" }, { "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "date": "2008-12-10" }, { "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" - }, - { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" - }, - { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" - }, - { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" - }, - { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "2008-12-11" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2009____2009_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2009____2009_.snap index 14d82b72..3ac0bfbf 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2009____2009_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2009____2009_.snap @@ -1,70 +1,66 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2009-01-01" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2009-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2009-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2009-05-19" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2009-08-30" }, { "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "date": "2009-09-19" }, { "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "date": "2009-09-20" }, { "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "date": "2009-09-21" }, { "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" - }, - { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "date": "2009-09-22" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2009-10-28" }, { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "name": "Cumhuriyet Bayram\u0131", + "date": "2009-10-29" }, { "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "date": "2009-11-26" }, { "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "2009-11-27" }, { "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "date": "2009-11-28" }, { "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "date": "2009-11-29" }, { "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" - }, - { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" - }, - { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" - }, - { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" - }, - { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "2009-11-30" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2016____2016_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2016____2016_.snap index 14d82b72..b94e88d0 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2016____2016_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2016____2016_.snap @@ -1,70 +1,66 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2016-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2016-04-23" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2016-05-01" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2016-05-19" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2016-07-04" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2016-07-05" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2016-07-06" }, { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2016-07-07" + }, + { + "name": "Zafer Bayram\u0131", + "date": "2016-08-30" }, { "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "date": "2016-09-11" }, { "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "2016-09-12" }, { "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "date": "2016-09-13" }, { "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "date": "2016-09-14" }, { "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" - }, - { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" - }, - { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "date": "2016-09-15" }, { "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "date": "2016-10-28" }, { "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "2016-10-29" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2017____2017_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2017____2017_.snap index 14d82b72..054f2126 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2017____2017_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2017____2017_.snap @@ -1,70 +1,70 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2017-01-01" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2017-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2017-05-01" + }, + { + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2017-05-19" }, { "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "date": "2017-06-24" }, { "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "date": "2017-06-25" }, { "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "date": "2017-06-26" }, { "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" - }, - { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "date": "2017-06-27" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2017-07-15" }, { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "name": "Zafer Bayram\u0131", + "date": "2017-08-30" }, { "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "date": "2017-08-31" }, { "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "2017-09-01" }, { "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "date": "2017-09-02" }, { "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "date": "2017-09-03" }, { "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" - }, - { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" - }, - { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "date": "2017-09-04" }, { "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "date": "2017-10-28" }, { "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "2017-10-29" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2021____2021_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2021____2021_.snap index 14d82b72..97508a51 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2021____2021_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2021____2021_.snap @@ -1,70 +1,70 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2021-01-01" + }, + { + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2021-04-23" + }, + { + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2021-05-01" }, { "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "date": "2021-05-12" }, { "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "date": "2021-05-13" }, { "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "date": "2021-05-14" }, { "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" - }, - { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "date": "2021-05-15" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2021-05-19" }, { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2021-07-15" }, { "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "date": "2021-07-19" }, { "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "2021-07-20" }, { "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "date": "2021-07-21" }, { "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "date": "2021-07-22" }, { "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" - }, - { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "date": "2021-07-23" }, { "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "date": "2021-08-30" }, { "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "date": "2021-10-28" }, { "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "2021-10-29" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2022____2022_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2022____2022_.snap index 14d82b72..7da33ee1 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2022____2022_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2022____2022_.snap @@ -1,70 +1,70 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2022-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2022-04-23" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2022-05-01" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2022-05-01" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2022-05-02" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2022-05-03" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2022-05-04" }, { "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "date": "2022-05-19" }, { "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "date": "2022-07-08" }, { "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "2022-07-09" }, { "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "date": "2022-07-10" }, { "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "date": "2022-07-11" }, { "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "date": "2022-07-12" }, { "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "date": "2022-07-15" }, { "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "date": "2022-08-30" }, { "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "date": "2022-10-28" }, { "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "2022-10-29" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2023____2023_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2023____2023_.snap index 14d82b72..5e90c2c5 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2023____2023_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2023____2023_.snap @@ -1,70 +1,70 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2023-01-01" }, { "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "date": "2023-04-20" }, { "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "date": "2023-04-21" }, { "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "date": "2023-04-22" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2023-04-23" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2023-04-23" }, { "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "date": "2023-05-01" }, { "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "date": "2023-05-19" }, { "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "date": "2023-06-27" }, { "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "2023-06-28" }, { "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "date": "2023-06-29" }, { "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "date": "2023-06-30" }, { "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "date": "2023-07-01" }, { "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "date": "2023-07-15" }, { "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "date": "2023-08-30" }, { "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "date": "2023-10-28" }, { "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "2023-10-29" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2025____2025_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2025____2025_.snap index 14d82b72..d4719a79 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2025____2025_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2025____2025_.snap @@ -1,70 +1,70 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2025-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2025-04-23" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2025-04-29" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2025-04-30" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2025-05-01" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2025-05-01" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2025-05-02" }, { "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "date": "2025-05-19" }, { "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "date": "2025-06-05" }, { "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "date": "2025-06-06" }, { "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "date": "2025-06-07" }, { "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "date": "2025-06-08" }, { "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "date": "2025-06-09" }, { "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "date": "2025-07-15" }, { "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "date": "2025-08-30" }, { "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "date": "2025-10-28" }, { "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "2025-10-29" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2032____2032_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2032____2032_.snap index 14d82b72..b20e6048 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2032____2032_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2032____2032_.snap @@ -1,70 +1,70 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2032-01-01" }, { "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "date": "2032-01-13" }, { "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "date": "2032-01-14" }, { "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "date": "2032-01-15" }, { "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "date": "2032-01-16" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2032-03-20" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2032-03-21" }, { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2032-03-22" }, { - "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2032-03-23" }, { - "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2032-03-24" }, { - "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2032-04-23" }, { - "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2032-05-01" }, { - "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2032-05-19" }, { "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "date": "2032-07-15" }, { "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "date": "2032-08-30" }, { "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "date": "2032-10-28" }, { "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "2032-10-29" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2033____2033_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2033____2033_.snap index 14d82b72..bf66f3b3 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2033____2033_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2033____2033_.snap @@ -1,70 +1,86 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2033-01-01" }, { "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "date": "2033-01-01" }, { "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "date": "2033-01-02" }, { "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "date": "2033-01-03" }, { "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "date": "2033-01-04" }, { - "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2033-03-10" }, { - "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2033-03-11" }, { - "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2033-03-12" }, { - "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2033-03-13" }, { - "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2033-03-14" }, { - "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", + "date": "2033-04-23" }, { - "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", + "date": "2033-05-01" }, { - "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", + "date": "2033-05-19" }, { "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "date": "2033-07-15" }, { "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "date": "2033-08-30" }, { "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "date": "2033-10-28" }, { "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "date": "2033-10-29" + }, + { + "name": "2. Ramazan Bayram\u0131 Arifesi", + "date": "2033-12-22" + }, + { + "name": "2. Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2033-12-23" + }, + { + "name": "2. Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2033-12-24" + }, + { + "name": "2. Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2033-12-25" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2034____2034_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2034____2034_.snap index 14d82b72..d0df47b7 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2034____2034_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2034____2034_.snap @@ -1,70 +1,70 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2034-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2034-02-27" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2034-02-28" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2034-03-01" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2034-03-02" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2034-03-03" }, { "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "date": "2034-04-23" }, { "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "date": "2034-05-01" }, { "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "date": "2034-05-19" }, { - "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" - }, - { - "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2034-07-15" }, { - "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "name": "Zafer Bayram\u0131", + "date": "2034-08-30" }, { - "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2034-10-28" }, { - "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "name": "Cumhuriyet Bayram\u0131", + "date": "2034-10-29" }, { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2034-12-10" }, { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2034-12-11" }, { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2034-12-12" }, { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2034-12-13" } ] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2037____2037_.snap b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2037____2037_.snap index 14d82b72..a8fc796e 100644 --- a/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2037____2037_.snap +++ b/tests/.pest/snapshots/Countries/TurkeyTest/it_can_calculate_turkey_holidays_with_data_set___2037____2037_.snap @@ -1,70 +1,70 @@ [ { "name": "Y\u0131lba\u015f\u0131", - "date": "2024-01-01" + "date": "2037-01-01" }, { - "name": "Ramazan Bayram\u0131 Arifesi", - "date": "2024-04-09" + "name": "Kurban Bayram\u0131 Arifesi", + "date": "2037-01-25" }, { - "name": "Ramazan Bayram\u0131 1. G\u00fcn", - "date": "2024-04-10" + "name": "Kurban Bayram\u0131 1. G\u00fcn", + "date": "2037-01-26" }, { - "name": "Ramazan Bayram\u0131 2. G\u00fcn", - "date": "2024-04-11" + "name": "Kurban Bayram\u0131 2. G\u00fcn", + "date": "2037-01-27" }, { - "name": "Ramazan Bayram\u0131 3. G\u00fcn", - "date": "2024-04-12" + "name": "Kurban Bayram\u0131 3. G\u00fcn", + "date": "2037-01-28" + }, + { + "name": "Kurban Bayram\u0131 4. G\u00fcn", + "date": "2037-01-29" }, { "name": "Ulusal Egemenlik ve \u00c7ocuk Bayram\u0131", - "date": "2024-04-23" + "date": "2037-04-23" }, { "name": "Emek ve Dayan\u0131\u015fma G\u00fcn\u00fc", - "date": "2024-05-01" + "date": "2037-05-01" }, { "name": "Atat\u00fcrk'\u00fc Anma, Gen\u00e7lik ve Spor Bayram\u0131", - "date": "2024-05-19" + "date": "2037-05-19" }, { - "name": "Kurban Bayram\u0131 Arifesi", - "date": "2024-06-15" - }, - { - "name": "Kurban Bayram\u0131 1. G\u00fcn", - "date": "2024-06-16" + "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", + "date": "2037-07-15" }, { - "name": "Kurban Bayram\u0131 2. G\u00fcn", - "date": "2024-06-17" + "name": "Zafer Bayram\u0131", + "date": "2037-08-30" }, { - "name": "Kurban Bayram\u0131 3. G\u00fcn", - "date": "2024-06-18" + "name": "Cumhuriyet Bayram\u0131 Arifesi", + "date": "2037-10-28" }, { - "name": "Kurban Bayram\u0131 4. G\u00fcn", - "date": "2024-06-19" + "name": "Cumhuriyet Bayram\u0131", + "date": "2037-10-29" }, { - "name": "Demokrasi ve Mill\u00ee Birlik G\u00fcn\u00fc", - "date": "2024-07-15" + "name": "Ramazan Bayram\u0131 Arifesi", + "date": "2037-11-08" }, { - "name": "Zafer Bayram\u0131", - "date": "2024-08-30" + "name": "Ramazan Bayram\u0131 1. G\u00fcn", + "date": "2037-11-09" }, { - "name": "Cumhuriyet Bayram\u0131 Arifesi", - "date": "2024-10-28" + "name": "Ramazan Bayram\u0131 2. G\u00fcn", + "date": "2037-11-10" }, { - "name": "Cumhuriyet Bayram\u0131", - "date": "2024-10-29" + "name": "Ramazan Bayram\u0131 3. G\u00fcn", + "date": "2037-11-11" } ] \ No newline at end of file diff --git a/tests/Countries/TurkeyTest.php b/tests/Countries/TurkeyTest.php index 7579c764..4deb524c 100644 --- a/tests/Countries/TurkeyTest.php +++ b/tests/Countries/TurkeyTest.php @@ -5,8 +5,8 @@ use Carbon\CarbonImmutable; use Spatie\Holidays\Holidays; -it('can calculate turkey holidays', function () { - CarbonImmutable::setTestNowAndTimezone('2024-01-01'); +it('can calculate turkey holidays', function ($year) { + CarbonImmutable::setTestNowAndTimezone($year.'-01-01'); $holidays = Holidays::for(country: 'tr')->get(); From 962b4f3e1e8aeeaa6c6a58c7db5fb8bf3b6a28bd Mon Sep 17 00:00:00 2001 From: thecaliskan Date: Sat, 20 Jan 2024 21:26:10 +0300 Subject: [PATCH 22/66] Fixed PHPStan --- src/Countries/Turkey.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Countries/Turkey.php b/src/Countries/Turkey.php index 698b7853..e6ca1be4 100644 --- a/src/Countries/Turkey.php +++ b/src/Countries/Turkey.php @@ -3,6 +3,7 @@ namespace Spatie\Holidays\Countries; use Carbon\CarbonImmutable; +use Exception; class Turkey extends Country { @@ -230,7 +231,8 @@ protected function getIslamicHolidays( if ($year != 1970) { $previousHoliday = is_array($holidays[$year - 1]) ? $holidays[$year - 1][1] : $holidays[$year - 1]; - $previousHoliday = CarbonImmutable::createFromFormat('Y-m-d', ($year - 1).'-'.$previousHoliday); + $previousHoliday = CarbonImmutable::createFromFormat('Y-m-d', ($year - 1).'-'.$previousHoliday) + ?: throw new Exception('Date could not be created.'); if ($previousHoliday->addDays($day - 1)->year == $year) { $islamicHolidays = $this->prepareHolidays( @@ -246,7 +248,8 @@ protected function getIslamicHolidays( $currentYearHolidays = is_array($holidays[$year]) ? $holidays[$year] : [$holidays[$year]]; foreach ($currentYearHolidays as $currentYearHoliday) { - $currentYearHoliday = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-{$currentYearHoliday}"); + $currentYearHoliday = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-{$currentYearHoliday}") + ?: throw new Exception('Date could not be created.'); $islamicHolidays = array_merge($islamicHolidays, $this->prepareHolidays( holiday: $currentYearHoliday, @@ -261,7 +264,8 @@ protected function getIslamicHolidays( if ($year != 2037) { $nextHoliday = is_array($holidays[$year + 1]) ? $holidays[$year + 1][1] : $holidays[$year + 1]; - $nextHoliday = CarbonImmutable::createFromFormat('Y-m-d', ($year + 1).'-'.$nextHoliday); + $nextHoliday = CarbonImmutable::createFromFormat('Y-m-d', ($year + 1).'-'.$nextHoliday) + ?: throw new Exception('Date could not be created.'); if ($nextHoliday->addDays(-1)->year == $year) { $islamicHolidays = array_merge($islamicHolidays, $this->prepareHolidays( From 038db024da2850e4c770996d754190f6758afc38 Mon Sep 17 00:00:00 2001 From: thecaliskan Date: Sat, 20 Jan 2024 21:28:02 +0300 Subject: [PATCH 23/66] Fixed PHPStan --- src/Countries/Turkey.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Countries/Turkey.php b/src/Countries/Turkey.php index e6ca1be4..356ccfd0 100644 --- a/src/Countries/Turkey.php +++ b/src/Countries/Turkey.php @@ -3,7 +3,7 @@ namespace Spatie\Holidays\Countries; use Carbon\CarbonImmutable; -use Exception; +use RuntimeException; class Turkey extends Country { @@ -232,7 +232,7 @@ protected function getIslamicHolidays( $previousHoliday = is_array($holidays[$year - 1]) ? $holidays[$year - 1][1] : $holidays[$year - 1]; $previousHoliday = CarbonImmutable::createFromFormat('Y-m-d', ($year - 1).'-'.$previousHoliday) - ?: throw new Exception('Date could not be created.'); + ?: throw new RuntimeException('Date could not be created.'); if ($previousHoliday->addDays($day - 1)->year == $year) { $islamicHolidays = $this->prepareHolidays( @@ -249,7 +249,7 @@ protected function getIslamicHolidays( foreach ($currentYearHolidays as $currentYearHoliday) { $currentYearHoliday = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-{$currentYearHoliday}") - ?: throw new Exception('Date could not be created.'); + ?: throw new RuntimeException('Date could not be created.'); $islamicHolidays = array_merge($islamicHolidays, $this->prepareHolidays( holiday: $currentYearHoliday, @@ -265,7 +265,7 @@ protected function getIslamicHolidays( $nextHoliday = is_array($holidays[$year + 1]) ? $holidays[$year + 1][1] : $holidays[$year + 1]; $nextHoliday = CarbonImmutable::createFromFormat('Y-m-d', ($year + 1).'-'.$nextHoliday) - ?: throw new Exception('Date could not be created.'); + ?: throw new RuntimeException('Date could not be created.'); if ($nextHoliday->addDays(-1)->year == $year) { $islamicHolidays = array_merge($islamicHolidays, $this->prepareHolidays( From 15dc453ac33830e958f4870381e71ca2b8a4dd49 Mon Sep 17 00:00:00 2001 From: Avdyl Krasniqi Date: Sat, 20 Jan 2024 21:01:22 +0100 Subject: [PATCH 24/66] Republic of Kosovo Holidays, Todo: implement islamic holidays --- src/Countries/Kosovo.php | 42 +++++++++++++++++++ .../it_can_calculate_kosovo_holidays.snap | 38 +++++++++++++++++ tests/Countries/KosovoTest.php | 18 ++++++++ 3 files changed, 98 insertions(+) create mode 100644 src/Countries/Kosovo.php create mode 100644 tests/.pest/snapshots/Countries/KosovoTest/it_can_calculate_kosovo_holidays.snap create mode 100644 tests/Countries/KosovoTest.php diff --git a/src/Countries/Kosovo.php b/src/Countries/Kosovo.php new file mode 100644 index 00000000..e108da15 --- /dev/null +++ b/src/Countries/Kosovo.php @@ -0,0 +1,42 @@ + '01-01', + 'Krishtlindjet ortodokse' => '01-06', + 'Dita Ndërkombëtare e Punës' => '05-01', + 'Dita e Evropës' => '05-09', + 'Krishtlindjet Katolike' => '12-25', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $holidays = []; + + $holidays['Pashkët Katolike'] = $this->easter($year); + $holidays['Pashkët Ortodokse'] = $this->orthodoxEaster($year); + + if($year >= 2008) { + $holidays['Dita e Pavarësisë së Republikës së Kosovës'] = '02-17'; + $holidays['Dita e Kushtetutës së Republikës së Kosovës'] = '04-09'; + } + + // TODO: Implement islamic holidays + + return $holidays; + } +} diff --git a/tests/.pest/snapshots/Countries/KosovoTest/it_can_calculate_kosovo_holidays.snap b/tests/.pest/snapshots/Countries/KosovoTest/it_can_calculate_kosovo_holidays.snap new file mode 100644 index 00000000..9115c976 --- /dev/null +++ b/tests/.pest/snapshots/Countries/KosovoTest/it_can_calculate_kosovo_holidays.snap @@ -0,0 +1,38 @@ +[ + { + "name": "Viti i Ri", + "date": "2024-01-01" + }, + { + "name": "Krishtlindjet ortodokse", + "date": "2024-01-06" + }, + { + "name": "Dita e Pavar\u00ebsis\u00eb s\u00eb Republik\u00ebs s\u00eb Kosov\u00ebs", + "date": "2024-02-17" + }, + { + "name": "Pashk\u00ebt Katolike", + "date": "2024-03-31" + }, + { + "name": "Dita e Kushtetut\u00ebs s\u00eb Republik\u00ebs s\u00eb Kosov\u00ebs", + "date": "2024-04-09" + }, + { + "name": "Dita Nd\u00ebrkomb\u00ebtare e Pun\u00ebs", + "date": "2024-05-01" + }, + { + "name": "Pashk\u00ebt Ortodokse", + "date": "2024-05-05" + }, + { + "name": "Dita e Evrop\u00ebs", + "date": "2024-05-09" + }, + { + "name": "Krishtlindjet Katolike", + "date": "2024-12-25" + } +] \ No newline at end of file diff --git a/tests/Countries/KosovoTest.php b/tests/Countries/KosovoTest.php new file mode 100644 index 00000000..2621722f --- /dev/null +++ b/tests/Countries/KosovoTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From 55ec02624b36b2778ef44c917fc2c217d6b02613 Mon Sep 17 00:00:00 2001 From: Avdyl Krasniqi Date: Sat, 20 Jan 2024 21:03:22 +0100 Subject: [PATCH 25/66] fix wrong date --- src/Countries/Kosovo.php | 2 +- .../Countries/KosovoTest/it_can_calculate_kosovo_holidays.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Countries/Kosovo.php b/src/Countries/Kosovo.php index e108da15..4d395117 100644 --- a/src/Countries/Kosovo.php +++ b/src/Countries/Kosovo.php @@ -15,7 +15,7 @@ protected function allHolidays(int $year): array { return array_merge([ 'Viti i Ri' => '01-01', - 'Krishtlindjet ortodokse' => '01-06', + 'Krishtlindjet ortodokse' => '01-07', 'Dita Ndërkombëtare e Punës' => '05-01', 'Dita e Evropës' => '05-09', 'Krishtlindjet Katolike' => '12-25', diff --git a/tests/.pest/snapshots/Countries/KosovoTest/it_can_calculate_kosovo_holidays.snap b/tests/.pest/snapshots/Countries/KosovoTest/it_can_calculate_kosovo_holidays.snap index 9115c976..895be7bc 100644 --- a/tests/.pest/snapshots/Countries/KosovoTest/it_can_calculate_kosovo_holidays.snap +++ b/tests/.pest/snapshots/Countries/KosovoTest/it_can_calculate_kosovo_holidays.snap @@ -5,7 +5,7 @@ }, { "name": "Krishtlindjet ortodokse", - "date": "2024-01-06" + "date": "2024-01-07" }, { "name": "Dita e Pavar\u00ebsis\u00eb s\u00eb Republik\u00ebs s\u00eb Kosov\u00ebs", From 89c20d04ba78f0f9f5f81b43177b2d21b030828e Mon Sep 17 00:00:00 2001 From: thecaliskan Date: Sun, 21 Jan 2024 00:25:31 +0300 Subject: [PATCH 26/66] Fixed year --- src/Countries/Turkey.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Countries/Turkey.php b/src/Countries/Turkey.php index 356ccfd0..f6bf6e7b 100644 --- a/src/Countries/Turkey.php +++ b/src/Countries/Turkey.php @@ -9,7 +9,7 @@ class Turkey extends Country { /** * No library or built-in php intl functions convert dates properly for all years or all country including - * “geniusts/hijri-dates”. It is most logical to prepare the dates between 1970 and 1938 as a constant property + * “geniusts/hijri-dates”. It is most logical to prepare the dates between 1970 and 2037 as a constant property * for Islamic holidays. Because Islamic holidays predicted and actual dates may change until the last moment. * Since the information on wikipedia is incorrect, it was obtained by searching the old calendar * on Google Images for each year. The accuracy of the information has been double checked. From 82c27a9d32fc03f5162c0010ff7a5d3a0ac9b1ad Mon Sep 17 00:00:00 2001 From: thecaliskan Date: Sun, 21 Jan 2024 00:26:55 +0300 Subject: [PATCH 27/66] fixed syntax --- src/Countries/Turkey.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Countries/Turkey.php b/src/Countries/Turkey.php index f6bf6e7b..5957d6fd 100644 --- a/src/Countries/Turkey.php +++ b/src/Countries/Turkey.php @@ -12,8 +12,8 @@ class Turkey extends Country * “geniusts/hijri-dates”. It is most logical to prepare the dates between 1970 and 2037 as a constant property * for Islamic holidays. Because Islamic holidays predicted and actual dates may change until the last moment. * Since the information on wikipedia is incorrect, it was obtained by searching the old calendar - * on Google Images for each year. The accuracy of the information has been double checked. - * Ramadan and Eid al-Adha vary for Turkey and other countries. + * on Google Images for each year. The accuracy of the information has been double-checked. + * Ramadan and Sacrifice holidays vary for Turkey and other countries. * A converter algorithm that will cover all years does not seem possible. */ public const ramadanHolidays = [ From 948d35289006acede732fa58768691b00b22a5aa Mon Sep 17 00:00:00 2001 From: Avdyl Krasniqi Date: Sat, 20 Jan 2024 23:32:14 +0100 Subject: [PATCH 28/66] fix typo --- src/Countries/Kosovo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Countries/Kosovo.php b/src/Countries/Kosovo.php index 4d395117..87dfcc2f 100644 --- a/src/Countries/Kosovo.php +++ b/src/Countries/Kosovo.php @@ -22,7 +22,7 @@ protected function allHolidays(int $year): array ], $this->variableHolidays($year)); } - /** @return array */ + /** @return array */ protected function variableHolidays(int $year): array { $holidays = []; From 49e0daab56a7b781566cbf4d82097250b69c624f Mon Sep 17 00:00:00 2001 From: Stavros Date: Mon, 22 Jan 2024 12:36:37 +0200 Subject: [PATCH 29/66] fix conflict phpstan-beseline --- phpstan-baseline.neon | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 0f6d531f..51b9330f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -20,21 +20,6 @@ parameters: count: 1 path: src/Countries/Country.php - - - message: "#^Cannot call method addDay\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" - count: 1 - path: src/Countries/Greece.php - - - - message: "#^Cannot call method isSunday\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" - count: 1 - path: src/Countries/Greece.php - - - - message: "#^Method Spatie\\\\Holidays\\\\Countries\\\\Greece\\:\\:variableHolidays\\(\\) should return array\\ but returns array\\\\.$#" - count: 1 - path: src/Countries/Greece.php - - message: "#^Cannot call method isSunday\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" count: 1 From 2cd3fbf722db4121be9c0d45c76414b356683fa0 Mon Sep 17 00:00:00 2001 From: Stavros Date: Mon, 22 Jan 2024 12:41:28 +0200 Subject: [PATCH 30/66] fix conflict phpstan-beseline generate again --- phpstan-baseline.neon | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 51b9330f..0f6d531f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -20,6 +20,21 @@ parameters: count: 1 path: src/Countries/Country.php + - + message: "#^Cannot call method addDay\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" + count: 1 + path: src/Countries/Greece.php + + - + message: "#^Cannot call method isSunday\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" + count: 1 + path: src/Countries/Greece.php + + - + message: "#^Method Spatie\\\\Holidays\\\\Countries\\\\Greece\\:\\:variableHolidays\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: src/Countries/Greece.php + - message: "#^Cannot call method isSunday\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" count: 1 From b45dd8e88bc9ea2b80d3b99830093809d42ebe89 Mon Sep 17 00:00:00 2001 From: Eimantas Likas Date: Mon, 22 Jan 2024 13:30:34 +0200 Subject: [PATCH 31/66] Add Lithuanian holidays --- src/Countries/Lithuania.php | 42 ++++++++++++++ .../it_can_calculate_lithuanian_holidays.snap | 58 +++++++++++++++++++ tests/Countries/LithuaniaTest.php | 18 ++++++ 3 files changed, 118 insertions(+) create mode 100644 src/Countries/Lithuania.php create mode 100644 tests/.pest/snapshots/Countries/LithuaniaTest/it_can_calculate_lithuanian_holidays.snap create mode 100644 tests/Countries/LithuaniaTest.php diff --git a/src/Countries/Lithuania.php b/src/Countries/Lithuania.php new file mode 100644 index 00000000..3b78d60c --- /dev/null +++ b/src/Countries/Lithuania.php @@ -0,0 +1,42 @@ + '01-01', + 'Lietuvos valstybės atkūrimo diena' => '02-16', + 'Nepriklausomybės atkūrimo diena' => '03-11', + 'Tarptautinė darbo diena' => '05-01', + 'Joninės' => '06-24', + 'Karaliaus Mindaugo karūnavimo diena' => '07-06', + 'Žolinė' => '08-15', + 'Visų šventųjų diena' => '11-01', + 'Vėlinės' => '11-02', + 'Šv. Kūčios' => '12-24', + 'Šv. Kalėdos' => '12-25', + 'Šv. Kalėdų antroji diena' => '12-26', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = $this->easter($year); + + return [ + 'Velykos' => $easter, + 'Velykų antroji diena' => $easter->addDay(), + ]; + } +} diff --git a/tests/.pest/snapshots/Countries/LithuaniaTest/it_can_calculate_lithuanian_holidays.snap b/tests/.pest/snapshots/Countries/LithuaniaTest/it_can_calculate_lithuanian_holidays.snap new file mode 100644 index 00000000..40fe82df --- /dev/null +++ b/tests/.pest/snapshots/Countries/LithuaniaTest/it_can_calculate_lithuanian_holidays.snap @@ -0,0 +1,58 @@ +[ + { + "name": "Naujieji metai", + "date": "2024-01-01" + }, + { + "name": "Lietuvos valstyb\u0117s atk\u016brimo diena", + "date": "2024-02-16" + }, + { + "name": "Nepriklausomyb\u0117s atk\u016brimo diena", + "date": "2024-03-11" + }, + { + "name": "Velykos", + "date": "2024-03-31" + }, + { + "name": "Velyk\u0173 antroji diena", + "date": "2024-04-01" + }, + { + "name": "Tarptautin\u0117 darbo diena", + "date": "2024-05-01" + }, + { + "name": "Jonin\u0117s", + "date": "2024-06-24" + }, + { + "name": "Karaliaus Mindaugo kar\u016bnavimo diena", + "date": "2024-07-06" + }, + { + "name": "\u017dolin\u0117", + "date": "2024-08-15" + }, + { + "name": "Vis\u0173 \u0161vent\u0173j\u0173 diena", + "date": "2024-11-01" + }, + { + "name": "V\u0117lin\u0117s", + "date": "2024-11-02" + }, + { + "name": "\u0160v. K\u016b\u010dios", + "date": "2024-12-24" + }, + { + "name": "\u0160v. Kal\u0117dos", + "date": "2024-12-25" + }, + { + "name": "\u0160v. Kal\u0117d\u0173 antroji diena", + "date": "2024-12-26" + } +] \ No newline at end of file diff --git a/tests/Countries/LithuaniaTest.php b/tests/Countries/LithuaniaTest.php new file mode 100644 index 00000000..310f58f5 --- /dev/null +++ b/tests/Countries/LithuaniaTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From b2034ac7aa4be905a65bc7e791817bfd5396fda3 Mon Sep 17 00:00:00 2001 From: Stavros Date: Mon, 22 Jan 2024 14:14:21 +0200 Subject: [PATCH 32/66] update country orthodoxeaster --- src/Countries/Country.php | 17 +++++++++++++++-- src/Countries/Greece.php | 25 +------------------------ 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/Countries/Country.php b/src/Countries/Country.php index 3a09768d..85ba9b45 100644 --- a/src/Countries/Country.php +++ b/src/Countries/Country.php @@ -50,10 +50,23 @@ protected function easter(int $year): CarbonImmutable protected function orthodoxEaster(int $year): CarbonImmutable { - $timestamp = easter_date($year, CAL_EASTER_ALWAYS_JULIAN); + $a = $year % 4; + $b = $year % 7; + $c = $year % 19; + $d = (19 * $c + 15) % 30; + $e = (2 * $a + 4 * $b - $d + 34) % 7; + $month = (int) (($d + $e + 114) / 31); + $day = (($d + $e + 114) % 31) + 1; + // julian to gregorian + $jtg = (int) ($year / 100) - (int) ($year / 400) - 2; + + $easterDate = mktime(0, 0, 0, $month, $day + $jtg, $year); + + /*$timestamp = easter_date($year, CAL_EASTER_ALWAYS_JULIAN); $daysDifference = (int) ($year / 100) - (int) ($year / 400) - 2; - return CarbonImmutable::createFromTimestamp(strtotime("+$daysDifference days", $timestamp)); + return CarbonImmutable::createFromTimestamp(strtotime("+$daysDifference days", $timestamp));*/ + return CarbonImmutable::createFromTimestamp($easterDate); } public static function find(string $countryCode): ?Country diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index d05f4f75..87b63f9e 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -30,11 +30,7 @@ protected function allHolidays(int $year): array protected function variableHolidays(int $year): array { - $orthodox_easter = CarbonImmutable::createFromTimestamp( - $this->calculateOrthodoxEaster($year) - )->setTimezone("Europe/Athens"); - //$orthodox_easter = $this->orthodoxEaster($year); - + $orthodox_easter = $this->orthodoxEaster($year); $protomagia = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-05-01"); if ( @@ -58,23 +54,4 @@ protected function variableHolidays(int $year): array 'Αγίου Πνεύματος' => $orthodox_easter->addDays(50), //always Monday ]; } - - /** @return integer */ - protected function calculateOrthodoxEaster(int $year): int - { - $a = $year % 4; - $b = $year % 7; - $c = $year % 19; - $d = (19 * $c + 15) % 30; - $e = (2 * $a + 4 * $b - $d + 34) % 7; - $month = (int) (($d + $e + 114) / 31); - $day = (($d + $e + 114) % 31) + 1; - // julian to gregorian - $jtg = (int) ($year / 100) - (int) ($year / 400) - 2; - - $easterDate = mktime(0, 0, 0, $month, $day + $jtg, $year); - - return (int) $easterDate; - - } } \ No newline at end of file From ad2555d4c465f285e2e99ff088a69380583bf68c Mon Sep 17 00:00:00 2001 From: Stavros Date: Mon, 22 Jan 2024 15:33:36 +0200 Subject: [PATCH 33/66] Update Country.php cleanup --- src/Countries/Country.php | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/Countries/Country.php b/src/Countries/Country.php index 85ba9b45..64bc75c1 100644 --- a/src/Countries/Country.php +++ b/src/Countries/Country.php @@ -51,21 +51,16 @@ protected function easter(int $year): CarbonImmutable protected function orthodoxEaster(int $year): CarbonImmutable { $a = $year % 4; - $b = $year % 7; - $c = $year % 19; - $d = (19 * $c + 15) % 30; - $e = (2 * $a + 4 * $b - $d + 34) % 7; - $month = (int) (($d + $e + 114) / 31); - $day = (($d + $e + 114) % 31) + 1; - // julian to gregorian - $jtg = (int) ($year / 100) - (int) ($year / 400) - 2; + $b = $year % 7; + $c = $year % 19; + $d = (19 * $c + 15) % 30; + $e = (2 * $a + 4 * $b - $d + 34) % 7; + $month = (int) (($d + $e + 114) / 31); + $day = (($d + $e + 114) % 31) + 1; + // julian to gregorian + $jtg = (int) ($year / 100) - (int) ($year / 400) - 2; + $easterDate = mktime(0, 0, 0, $month, $day + $jtg, $year); - $easterDate = mktime(0, 0, 0, $month, $day + $jtg, $year); - - /*$timestamp = easter_date($year, CAL_EASTER_ALWAYS_JULIAN); - $daysDifference = (int) ($year / 100) - (int) ($year / 400) - 2; - - return CarbonImmutable::createFromTimestamp(strtotime("+$daysDifference days", $timestamp));*/ return CarbonImmutable::createFromTimestamp($easterDate); } From e0fff55d9eb4915f17ea37b9406e99b3fd6b5583 Mon Sep 17 00:00:00 2001 From: Stavros Date: Mon, 22 Jan 2024 16:28:06 +0200 Subject: [PATCH 34/66] reduce baseline errors --- phpstan-baseline.neon | 15 --------------- src/Countries/Greece.php | 1 + 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 626ee351..8364bfa9 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -25,21 +25,6 @@ parameters: count: 1 path: src/Countries/Country.php - - - message: "#^Cannot call method addDay\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" - count: 1 - path: src/Countries/Greece.php - - - - message: "#^Cannot call method isSunday\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" - count: 1 - path: src/Countries/Greece.php - - - - message: "#^Method Spatie\\\\Holidays\\\\Countries\\\\Greece\\:\\:variableHolidays\\(\\) should return array\\ but returns array\\\\.$#" - count: 1 - path: src/Countries/Greece.php - - message: "#^Cannot call method setTimezone\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" count: 1 diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index 87b63f9e..ccf9a685 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -31,6 +31,7 @@ protected function variableHolidays(int $year): array { $orthodox_easter = $this->orthodoxEaster($year); + /** @var CarbonImmutable $protomagia */ $protomagia = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-05-01"); if ( From d8c45403f88134a09688405311890618204099c6 Mon Sep 17 00:00:00 2001 From: Stavros Date: Mon, 22 Jan 2024 16:43:57 +0200 Subject: [PATCH 35/66] camelCase change --- src/Countries/Greece.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index ccf9a685..cb268d6d 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -30,29 +30,29 @@ protected function allHolidays(int $year): array protected function variableHolidays(int $year): array { - $orthodox_easter = $this->orthodoxEaster($year); + $orthodoxEaster = $this->orthodoxEaster($year); /** @var CarbonImmutable $protomagia */ $protomagia = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-05-01"); if ( - $protomagia == $orthodox_easter->subDays(2) || - $protomagia == $orthodox_easter->subDays(1) || - $protomagia == $orthodox_easter || - $protomagia == $orthodox_easter->addDay() + $protomagia == $orthodoxEaster->subDays(2) || + $protomagia == $orthodoxEaster->subDays(1) || + $protomagia == $orthodoxEaster || + $protomagia == $orthodoxEaster->addDay() ) { - $protomagia = $orthodox_easter->addDays(2); + $protomagia = $orthodoxEaster->addDays(2); } if ($protomagia->isSunday()) { $protomagia = $protomagia->addDay(); } return [ - 'Καθαρά Δευτέρα' => $orthodox_easter->subDays(48), //always Monday + 'Καθαρά Δευτέρα' => $orthodoxEaster->subDays(48), //always Monday 'Πρωτομαγιά' => $protomagia, - 'Μεγάλη Παρασκευή' => $orthodox_easter->subDays(2), - 'Κυριακή του Πάσχα' => $orthodox_easter, - 'Δευτέρα του Πάσχα' => $orthodox_easter->addDay(), - 'Αγίου Πνεύματος' => $orthodox_easter->addDays(50), //always Monday + 'Μεγάλη Παρασκευή' => $orthodoxEaster->subDays(2), + 'Κυριακή του Πάσχα' => $orthodoxEaster, + 'Δευτέρα του Πάσχα' => $orthodoxEaster->addDay(), + 'Αγίου Πνεύματος' => $orthodoxEaster->addDays(50), //always Monday ]; } } \ No newline at end of file From 00c99a7e0fbc839a23e5636a5a1fa01bd5070085 Mon Sep 17 00:00:00 2001 From: Stavros Date: Mon, 22 Jan 2024 18:28:08 +0200 Subject: [PATCH 36/66] restorer Country.php / add timezone --- src/Countries/Country.php | 16 ++++------------ src/Countries/Greece.php | 4 ++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Countries/Country.php b/src/Countries/Country.php index 64bc75c1..3a09768d 100644 --- a/src/Countries/Country.php +++ b/src/Countries/Country.php @@ -50,18 +50,10 @@ protected function easter(int $year): CarbonImmutable protected function orthodoxEaster(int $year): CarbonImmutable { - $a = $year % 4; - $b = $year % 7; - $c = $year % 19; - $d = (19 * $c + 15) % 30; - $e = (2 * $a + 4 * $b - $d + 34) % 7; - $month = (int) (($d + $e + 114) / 31); - $day = (($d + $e + 114) % 31) + 1; - // julian to gregorian - $jtg = (int) ($year / 100) - (int) ($year / 400) - 2; - $easterDate = mktime(0, 0, 0, $month, $day + $jtg, $year); - - return CarbonImmutable::createFromTimestamp($easterDate); + $timestamp = easter_date($year, CAL_EASTER_ALWAYS_JULIAN); + $daysDifference = (int) ($year / 100) - (int) ($year / 400) - 2; + + return CarbonImmutable::createFromTimestamp(strtotime("+$daysDifference days", $timestamp)); } public static function find(string $countryCode): ?Country diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index cb268d6d..9f41be52 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -29,8 +29,8 @@ protected function allHolidays(int $year): array /** @return array */ protected function variableHolidays(int $year): array { - - $orthodoxEaster = $this->orthodoxEaster($year); + // OrthodoxEaster needs to setTimezone + $orthodoxEaster = $this->orthodoxEaster($year)->setTimezone("Europe/Athens"); /** @var CarbonImmutable $protomagia */ $protomagia = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-05-01"); From 6342868ce3882c4251ed5043818678f07b634465 Mon Sep 17 00:00:00 2001 From: Stavros Date: Tue, 23 Jan 2024 13:48:05 +0200 Subject: [PATCH 37/66] Common orthodox easter date on all timezones --- src/Countries/Country.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Countries/Country.php b/src/Countries/Country.php index 3a09768d..f23f9ea6 100644 --- a/src/Countries/Country.php +++ b/src/Countries/Country.php @@ -53,7 +53,11 @@ protected function orthodoxEaster(int $year): CarbonImmutable $timestamp = easter_date($year, CAL_EASTER_ALWAYS_JULIAN); $daysDifference = (int) ($year / 100) - (int) ($year / 400) - 2; - return CarbonImmutable::createFromTimestamp(strtotime("+$daysDifference days", $timestamp)); + // Common orthodox easter date on all timezones + return CarbonImmutable::createFromTimestamp($timestamp) + ->setTime(0, 0, 0) + ->addDays($daysDifference + 1); + //return CarbonImmutable::createFromTimestamp(strtotime("+$daysDifference days", $timestamp)); } public static function find(string $countryCode): ?Country From 49ddfe3423ed08a2c75b08f204728f482769fc45 Mon Sep 17 00:00:00 2001 From: Stavros Date: Tue, 23 Jan 2024 14:00:48 +0200 Subject: [PATCH 38/66] Common orthodox easter date on all timezones - cleanup --- src/Countries/Country.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Countries/Country.php b/src/Countries/Country.php index f23f9ea6..6697d4c3 100644 --- a/src/Countries/Country.php +++ b/src/Countries/Country.php @@ -54,9 +54,7 @@ protected function orthodoxEaster(int $year): CarbonImmutable $daysDifference = (int) ($year / 100) - (int) ($year / 400) - 2; // Common orthodox easter date on all timezones - return CarbonImmutable::createFromTimestamp($timestamp) - ->setTime(0, 0, 0) - ->addDays($daysDifference + 1); + return CarbonImmutable::createFromTimestamp(strtotime("+$daysDifference days", $timestamp))->startOfDay()->addDay(); //return CarbonImmutable::createFromTimestamp(strtotime("+$daysDifference days", $timestamp)); } From 07454e6e1e2b9b513ab58ce23468fb871a24c875 Mon Sep 17 00:00:00 2001 From: Ivan Mercedes <53806989+ivanmercedes@users.noreply.github.com> Date: Tue, 23 Jan 2024 08:42:24 -0400 Subject: [PATCH 39/66] Added Haiti holidays (#148) --- src/Countries/Haiti.php | 41 +++++++++++++++ .../it_can_calculate_haiti_holidays.snap | 50 +++++++++++++++++++ tests/Countries/HaitiTest.php | 18 +++++++ 3 files changed, 109 insertions(+) create mode 100644 src/Countries/Haiti.php create mode 100644 tests/.pest/snapshots/Countries/HaitiTest/it_can_calculate_haiti_holidays.snap create mode 100644 tests/Countries/HaitiTest.php diff --git a/src/Countries/Haiti.php b/src/Countries/Haiti.php new file mode 100644 index 00000000..f35c3aa2 --- /dev/null +++ b/src/Countries/Haiti.php @@ -0,0 +1,41 @@ + */ + protected function allHolidays(int $year): array + { + return array_merge([ + 'Nouvel an / Jour de l\'Indépendance' => '01-01', + 'Jour des Aieux' => '01-2', + 'Fête du Travail / Fête des Travailleurs' => '05-01', + 'Jour du Drapeau et de l\'Université' => '05-18', + 'L\'Assomption de Marie' => '08-15', + 'Anniversaire de la mort de Dessalines' => '10-17', + 'Toussaint' => '11-01', + 'Jour des Morts' => '11-02', + 'Vertières' => '11-18', + 'Noël' => '12-25', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = $this->easter($year); + + return [ + 'Carnaval/Mardi Gras' => $easter->subDays(47), + 'Vendredi saint' => $easter->subDays(2), + ]; + } +} diff --git a/tests/.pest/snapshots/Countries/HaitiTest/it_can_calculate_haiti_holidays.snap b/tests/.pest/snapshots/Countries/HaitiTest/it_can_calculate_haiti_holidays.snap new file mode 100644 index 00000000..0a09db87 --- /dev/null +++ b/tests/.pest/snapshots/Countries/HaitiTest/it_can_calculate_haiti_holidays.snap @@ -0,0 +1,50 @@ +[ + { + "name": "Nouvel an \/ Jour de l'Ind\u00e9pendance", + "date": "2024-01-01" + }, + { + "name": "Jour des Aieux", + "date": "2024-01-02" + }, + { + "name": "Carnaval\/Mardi Gras", + "date": "2024-02-13" + }, + { + "name": "Vendredi saint", + "date": "2024-03-29" + }, + { + "name": "F\u00eate du Travail \/ F\u00eate des Travailleurs", + "date": "2024-05-01" + }, + { + "name": "Jour du Drapeau et de l'Universit\u00e9", + "date": "2024-05-18" + }, + { + "name": "L'Assomption de Marie", + "date": "2024-08-15" + }, + { + "name": "Anniversaire de la mort de Dessalines", + "date": "2024-10-17" + }, + { + "name": "Toussaint", + "date": "2024-11-01" + }, + { + "name": "Jour des Morts", + "date": "2024-11-02" + }, + { + "name": "Verti\u00e8res", + "date": "2024-11-18" + }, + { + "name": "No\u00ebl", + "date": "2024-12-25" + } +] \ No newline at end of file diff --git a/tests/Countries/HaitiTest.php b/tests/Countries/HaitiTest.php new file mode 100644 index 00000000..9e563276 --- /dev/null +++ b/tests/Countries/HaitiTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From 1d6960ea471bf6c567c21e58a67f4e7f8b819e02 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:43:06 +0100 Subject: [PATCH 40/66] remove unneeded annotation --- src/Countries/Haiti.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Countries/Haiti.php b/src/Countries/Haiti.php index f35c3aa2..d35ac125 100644 --- a/src/Countries/Haiti.php +++ b/src/Countries/Haiti.php @@ -11,7 +11,6 @@ public function countryCode(): string return 'ht'; } - /** @return array */ protected function allHolidays(int $year): array { return array_merge([ From 55f455f3df289c3b35295fe1bfd508e924f570e0 Mon Sep 17 00:00:00 2001 From: Florin Pavel Date: Tue, 23 Jan 2024 14:46:21 +0200 Subject: [PATCH 41/66] Add Romanian Holidays (#27) * add romanian holidays * add Epiphany and Saint John public holidays * fix static analysis * Fix styling * add formula to calculate the difference between Julian and Gregorian calendars * Fix styling * add the source of the orthodox easter algorithm * Fix styling * fix phpstan * remove orthodoxEaster function from Romania class --- src/Countries/Romania.php | 60 ++++++++++++++++ .../it_can_calculate_romanian_holidays.snap | 70 +++++++++++++++++++ tests/Countries/RomaniaTest.php | 19 +++++ 3 files changed, 149 insertions(+) create mode 100644 src/Countries/Romania.php create mode 100644 tests/.pest/snapshots/Countries/RomaniaTest/it_can_calculate_romanian_holidays.snap create mode 100644 tests/Countries/RomaniaTest.php diff --git a/src/Countries/Romania.php b/src/Countries/Romania.php new file mode 100644 index 00000000..c9e1775b --- /dev/null +++ b/src/Countries/Romania.php @@ -0,0 +1,60 @@ + */ + protected function allHolidays(int $year): array + { + return array_merge([ + 'Anul Nou' => '01-01', + 'A doua zi de Anul Nou' => '01-02', + 'Bobotează' => '01-06', + 'Sfântul Ion' => '01-07', + 'Ziua Unirii Principatelor Române' => '01-24', + 'Ziua Muncii' => '05-01', + 'Ziua Copilului' => '06-01', + 'Adormirea Maicii Domnului' => '08-15', + 'Sfântul Andrei' => '11-30', + 'Ziua Națională' => '12-01', + 'Crăciunul' => '12-25', + 'A doua zi de Crăciun' => '12-26', + ], $this->variableHolidays($year)); + } + + /** + * @return array + */ + protected function variableHolidays(int $year): array + { + $easter = $this->orthodoxEaster($year); + $easterMonday = $easter->addDay(); + $goodFriday = $easter->subDays(2); + + $pentecost = $this->orthodoxPentecost($year); + $pentecostMonday = $pentecost->addDay(); + + return [ + 'Vinerea Mare' => $goodFriday, + 'Paștele' => $easter, + 'A doua zi de Paște' => $easterMonday, + 'Rusaliile' => $pentecost, + 'A doua zi de Rusalii' => $pentecostMonday, + ]; + } + + protected function orthodoxPentecost(int $year): CarbonImmutable + { + $easter = $this->orthodoxEaster($year); + + return $easter->addDays(49); + } +} diff --git a/tests/.pest/snapshots/Countries/RomaniaTest/it_can_calculate_romanian_holidays.snap b/tests/.pest/snapshots/Countries/RomaniaTest/it_can_calculate_romanian_holidays.snap new file mode 100644 index 00000000..0c4fe65e --- /dev/null +++ b/tests/.pest/snapshots/Countries/RomaniaTest/it_can_calculate_romanian_holidays.snap @@ -0,0 +1,70 @@ +[ + { + "name": "Anul Nou", + "date": "2024-01-01" + }, + { + "name": "A doua zi de Anul Nou", + "date": "2024-01-02" + }, + { + "name": "Boboteaz\u0103", + "date": "2024-01-06" + }, + { + "name": "Sf\u00e2ntul Ion", + "date": "2024-01-07" + }, + { + "name": "Ziua Unirii Principatelor Rom\u00e2ne", + "date": "2024-01-24" + }, + { + "name": "Ziua Muncii", + "date": "2024-05-01" + }, + { + "name": "Vinerea Mare", + "date": "2024-05-03" + }, + { + "name": "Pa\u0219tele", + "date": "2024-05-05" + }, + { + "name": "A doua zi de Pa\u0219te", + "date": "2024-05-06" + }, + { + "name": "Ziua Copilului", + "date": "2024-06-01" + }, + { + "name": "Rusaliile", + "date": "2024-06-23" + }, + { + "name": "A doua zi de Rusalii", + "date": "2024-06-24" + }, + { + "name": "Adormirea Maicii Domnului", + "date": "2024-08-15" + }, + { + "name": "Sf\u00e2ntul Andrei", + "date": "2024-11-30" + }, + { + "name": "Ziua Na\u021bional\u0103", + "date": "2024-12-01" + }, + { + "name": "Cr\u0103ciunul", + "date": "2024-12-25" + }, + { + "name": "A doua zi de Cr\u0103ciun", + "date": "2024-12-26" + } +] \ No newline at end of file diff --git a/tests/Countries/RomaniaTest.php b/tests/Countries/RomaniaTest.php new file mode 100644 index 00000000..80c177a9 --- /dev/null +++ b/tests/Countries/RomaniaTest.php @@ -0,0 +1,19 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); + +}); From 6a84f1b519873cc7519bfadcfdd103e9e7e4b1e5 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:48:01 +0100 Subject: [PATCH 42/66] cleanup Romania --- src/Countries/Romania.php | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/Countries/Romania.php b/src/Countries/Romania.php index c9e1775b..7073fb78 100644 --- a/src/Countries/Romania.php +++ b/src/Countries/Romania.php @@ -11,7 +11,6 @@ public function countryCode(): string return 'ro'; } - /** @return array */ protected function allHolidays(int $year): array { return array_merge([ @@ -30,31 +29,17 @@ protected function allHolidays(int $year): array ], $this->variableHolidays($year)); } - /** - * @return array - */ + /** @return array */ protected function variableHolidays(int $year): array { $easter = $this->orthodoxEaster($year); - $easterMonday = $easter->addDay(); - $goodFriday = $easter->subDays(2); - - $pentecost = $this->orthodoxPentecost($year); - $pentecostMonday = $pentecost->addDay(); return [ - 'Vinerea Mare' => $goodFriday, + 'Vinerea Mare' => $easter->subDays(2), 'Paștele' => $easter, - 'A doua zi de Paște' => $easterMonday, - 'Rusaliile' => $pentecost, - 'A doua zi de Rusalii' => $pentecostMonday, + 'A doua zi de Paște' => $easter->addDay(), + 'Rusaliile' => $easter->addDays(49), + 'A doua zi de Rusalii' => $easter->addDays(50), ]; } - - protected function orthodoxPentecost(int $year): CarbonImmutable - { - $easter = $this->orthodoxEaster($year); - - return $easter->addDays(49); - } } From a336fdcc32ec02edf93ccfc367ecf47b44d7054c Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:51:37 +0100 Subject: [PATCH 43/66] fix issue in baseline --- phpstan-baseline.neon | 5 ----- src/Countries/Mexico.php | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8364bfa9..46ce0ede 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -25,11 +25,6 @@ parameters: count: 1 path: src/Countries/Country.php - - - message: "#^Cannot call method setTimezone\\(\\) on Carbon\\\\CarbonImmutable\\|false\\.$#" - count: 1 - path: src/Countries/Mexico.php - - message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(Carbon\\\\CarbonImmutable\\)\\: mixed\\)\\|null, Closure\\(string\\)\\: non\\-falsy\\-string given\\.$#" count: 1 diff --git a/src/Countries/Mexico.php b/src/Countries/Mexico.php index 1cb2cdfa..0ca4e61c 100644 --- a/src/Countries/Mexico.php +++ b/src/Countries/Mexico.php @@ -55,7 +55,7 @@ protected function governmentChangeDate(int $year): ?CarbonImmutable // Check if the current year is a transmission year if (($year - $baseYear) % 6 === 0) { - return CarbonImmutable::create($year, 10, 1) // October 1st of the transmission year + return CarbonImmutable::createFromDate($year, 10, 1) // October 1st of the transmission year ->setTimezone('America/Mexico_City'); } From 74d1956a8f23dcec239f296136c215a70bda4596 Mon Sep 17 00:00:00 2001 From: Jonnathan Chiroy Date: Tue, 23 Jan 2024 06:52:30 -0600 Subject: [PATCH 44/66] Add Guatemala holidays (#106) * add: guatemalan holidays * Add guatemalan holidays --------- Co-authored-by: ejchiroy --- src/Countries/Guatemala.php | 38 +++++++++++++++++ .../it_can_calculate_guatemalan_holidays.snap | 42 +++++++++++++++++++ tests/Countries/GuatemalaTest.php | 18 ++++++++ 3 files changed, 98 insertions(+) create mode 100644 src/Countries/Guatemala.php create mode 100644 tests/.pest/snapshots/Countries/GuatemalaTest/it_can_calculate_guatemalan_holidays.snap create mode 100644 tests/Countries/GuatemalaTest.php diff --git a/src/Countries/Guatemala.php b/src/Countries/Guatemala.php new file mode 100644 index 00000000..ea1c8f43 --- /dev/null +++ b/src/Countries/Guatemala.php @@ -0,0 +1,38 @@ + '01-01', + 'Día de los Trabajadores' => '05-01', + 'Día del Ejército' => '06-31', + 'Día de la Independencia' => '09-15', + 'Día de la Revolución' => '10-20', + 'Día de Todos los Santos' => '11-01', + 'Navidad' => '12-25', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = $this->easter($year); + + return [ + 'Jueves Santo' => $easter->subDays(3), + 'Viernes Santo' => $easter->subDays(2), + 'Sábado Santo' => $easter->subDays(1), + ]; + } +} diff --git a/tests/.pest/snapshots/Countries/GuatemalaTest/it_can_calculate_guatemalan_holidays.snap b/tests/.pest/snapshots/Countries/GuatemalaTest/it_can_calculate_guatemalan_holidays.snap new file mode 100644 index 00000000..9b15bf4e --- /dev/null +++ b/tests/.pest/snapshots/Countries/GuatemalaTest/it_can_calculate_guatemalan_holidays.snap @@ -0,0 +1,42 @@ +[ + { + "name": "A\u00f1o Nuevo", + "date": "2024-01-01" + }, + { + "name": "Jueves Santo", + "date": "2024-03-28" + }, + { + "name": "Viernes Santo", + "date": "2024-03-29" + }, + { + "name": "S\u00e1bado Santo", + "date": "2024-03-30" + }, + { + "name": "D\u00eda de los Trabajadores", + "date": "2024-05-01" + }, + { + "name": "D\u00eda del Ej\u00e9rcito", + "date": "2024-07-01" + }, + { + "name": "D\u00eda de la Independencia", + "date": "2024-09-15" + }, + { + "name": "D\u00eda de la Revoluci\u00f3n", + "date": "2024-10-20" + }, + { + "name": "D\u00eda de Todos los Santos", + "date": "2024-11-01" + }, + { + "name": "Navidad", + "date": "2024-12-25" + } +] \ No newline at end of file diff --git a/tests/Countries/GuatemalaTest.php b/tests/Countries/GuatemalaTest.php new file mode 100644 index 00000000..106ce7d4 --- /dev/null +++ b/tests/Countries/GuatemalaTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From 7a09493793cf481a6d69844acaaea30c07fde4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <73190968+UrbinCedric@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:53:02 +0100 Subject: [PATCH 45/66] Add holidays for Luxembourg (#165) --- src/Countries/Luxembourg.php | 39 ++++++++++++++++ ..._can_calculate_luxembourgish_holidays.snap | 46 +++++++++++++++++++ tests/Countries/LuxembourgTest.php | 18 ++++++++ 3 files changed, 103 insertions(+) create mode 100644 src/Countries/Luxembourg.php create mode 100644 tests/.pest/snapshots/Countries/LuxembourgTest/it_can_calculate_luxembourgish_holidays.snap create mode 100644 tests/Countries/LuxembourgTest.php diff --git a/src/Countries/Luxembourg.php b/src/Countries/Luxembourg.php new file mode 100644 index 00000000..e5f73fd8 --- /dev/null +++ b/src/Countries/Luxembourg.php @@ -0,0 +1,39 @@ + '01-01', + 'Dag vun der Aarbecht' => '05-01', + 'Europadag' => '05-09', + 'Nationalfeierdag' => '06-23', + 'Mariä Himmelfahrt' => '08-15', + 'Allerhellgen' => '11-01', + 'Chrëschtdag' => '12-25', + 'Stiefesdag' => '12-26', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = $this->easter($year); + + return [ + 'Ouschterméindeg' => $easter->addDay(), + 'Christi Himmelfahrt' => $easter->addDays(39), + 'Péngschtméindeg' => $easter->addDays(50), + ]; + } +} diff --git a/tests/.pest/snapshots/Countries/LuxembourgTest/it_can_calculate_luxembourgish_holidays.snap b/tests/.pest/snapshots/Countries/LuxembourgTest/it_can_calculate_luxembourgish_holidays.snap new file mode 100644 index 00000000..79f844c1 --- /dev/null +++ b/tests/.pest/snapshots/Countries/LuxembourgTest/it_can_calculate_luxembourgish_holidays.snap @@ -0,0 +1,46 @@ +[ + { + "name": "Neijoerschdag", + "date": "2024-01-01" + }, + { + "name": "Ouschterm\u00e9indeg", + "date": "2024-04-01" + }, + { + "name": "Dag vun der Aarbecht", + "date": "2024-05-01" + }, + { + "name": "Europadag", + "date": "2024-05-09" + }, + { + "name": "Christi Himmelfahrt", + "date": "2024-05-09" + }, + { + "name": "P\u00e9ngschtm\u00e9indeg", + "date": "2024-05-20" + }, + { + "name": "Nationalfeierdag", + "date": "2024-06-23" + }, + { + "name": "Mari\u00e4 Himmelfahrt", + "date": "2024-08-15" + }, + { + "name": "Allerhellgen", + "date": "2024-11-01" + }, + { + "name": "Chr\u00ebschtdag", + "date": "2024-12-25" + }, + { + "name": "Stiefesdag", + "date": "2024-12-26" + } +] \ No newline at end of file diff --git a/tests/Countries/LuxembourgTest.php b/tests/Countries/LuxembourgTest.php new file mode 100644 index 00000000..48c69782 --- /dev/null +++ b/tests/Countries/LuxembourgTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From a5b467a392ada0201ac48f10c17781510f670d9b Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Tue, 23 Jan 2024 15:00:21 +0200 Subject: [PATCH 46/66] Add holidays for South Africa (#30) --- src/Countries/SouthAfrica.php | 59 +++++++++++++++++++ ...t_can_calculate_south_africa_holidays.snap | 54 +++++++++++++++++ tests/Countries/SouthAfricaTest.php | 18 ++++++ 3 files changed, 131 insertions(+) create mode 100644 src/Countries/SouthAfrica.php create mode 100644 tests/.pest/snapshots/Countries/SouthAfricaTest/it_can_calculate_south_africa_holidays.snap create mode 100644 tests/Countries/SouthAfricaTest.php diff --git a/src/Countries/SouthAfrica.php b/src/Countries/SouthAfrica.php new file mode 100644 index 00000000..79e72d22 --- /dev/null +++ b/src/Countries/SouthAfrica.php @@ -0,0 +1,59 @@ + '01-01', + 'Human Rights Day' => '03-21', + 'Freedom Day' => '04-27', + 'Workers\' Day' => '05-01', + 'Youth Day' => '06-16', + 'National Women\'s Day' => '08-09', + 'Heritage Day' => '09-24', + 'Day of Reconciliation' => '12-16', + 'Christmas Day' => '12-25', + 'Day of Goodwill' => '12-26', + ]; + + foreach ($holidays as $name => $date) { + $holidayDate = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-{$date}"); + assert($holidayDate instanceof CarbonImmutable); + + // The Public Holidays Act (Act No 36 of 1994) states that whenever a public holiday falls on a Sunday, the Monday following it will be a public holiday. + // https://www.gov.za/documents/public-holidays-act + if ( + $holidayDate->isSunday() && + !in_array($holidayDate->addDay()->format('m-d'), $holidays, true) // Check that the Monday is not already a holiday + ) { + $holidays[$name . ' Observed'] = $holidayDate->addDay(); + } + } + + return array_merge($holidays, $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = $this->easter($year); + + return [ + 'Good Friday' => $easter->subDays(2), + 'Family Day' => $easter->addDay(), + ]; + } +} diff --git a/tests/.pest/snapshots/Countries/SouthAfricaTest/it_can_calculate_south_africa_holidays.snap b/tests/.pest/snapshots/Countries/SouthAfricaTest/it_can_calculate_south_africa_holidays.snap new file mode 100644 index 00000000..a77953f6 --- /dev/null +++ b/tests/.pest/snapshots/Countries/SouthAfricaTest/it_can_calculate_south_africa_holidays.snap @@ -0,0 +1,54 @@ +[ + { + "name": "New Year's Day", + "date": "2024-01-01" + }, + { + "name": "Human Rights Day", + "date": "2024-03-21" + }, + { + "name": "Good Friday", + "date": "2024-03-29" + }, + { + "name": "Family Day", + "date": "2024-04-01" + }, + { + "name": "Freedom Day", + "date": "2024-04-27" + }, + { + "name": "Workers' Day", + "date": "2024-05-01" + }, + { + "name": "Youth Day", + "date": "2024-06-16" + }, + { + "name": "Youth Day Observed", + "date": "2024-06-17" + }, + { + "name": "National Women's Day", + "date": "2024-08-09" + }, + { + "name": "Heritage Day", + "date": "2024-09-24" + }, + { + "name": "Day of Reconciliation", + "date": "2024-12-16" + }, + { + "name": "Christmas Day", + "date": "2024-12-25" + }, + { + "name": "Day of Goodwill", + "date": "2024-12-26" + } +] \ No newline at end of file diff --git a/tests/Countries/SouthAfricaTest.php b/tests/Countries/SouthAfricaTest.php new file mode 100644 index 00000000..fe98169c --- /dev/null +++ b/tests/Countries/SouthAfricaTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From 1b7ef835e7521dda88ba29dc094336b998927369 Mon Sep 17 00:00:00 2001 From: Nielsvanpach Date: Tue, 23 Jan 2024 13:00:44 +0000 Subject: [PATCH 47/66] Fix styling --- src/Countries/SouthAfrica.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Countries/SouthAfrica.php b/src/Countries/SouthAfrica.php index 79e72d22..64d40412 100644 --- a/src/Countries/SouthAfrica.php +++ b/src/Countries/SouthAfrica.php @@ -3,6 +3,7 @@ namespace Spatie\Holidays\Countries; use Carbon\CarbonImmutable; + use function in_array; class SouthAfrica extends Country @@ -37,9 +38,9 @@ protected function allHolidays(int $year): array // https://www.gov.za/documents/public-holidays-act if ( $holidayDate->isSunday() && - !in_array($holidayDate->addDay()->format('m-d'), $holidays, true) // Check that the Monday is not already a holiday + ! in_array($holidayDate->addDay()->format('m-d'), $holidays, true) // Check that the Monday is not already a holiday ) { - $holidays[$name . ' Observed'] = $holidayDate->addDay(); + $holidays[$name.' Observed'] = $holidayDate->addDay(); } } From d04ca0447d797bc6dd0b793dc9ed3fdc9a854179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20S=C3=A1nchez?= Date: Tue, 23 Jan 2024 08:01:41 -0500 Subject: [PATCH 48/66] Add Peru holidays (#54) * Adds Peru holidays * Adds Peru holidays * Use $this->easter factory and remoce comments on allHolidays method --- src/Countries/Peru.php | 44 +++++++++++++ .../it_can_calculate_peru_holidays.snap | 66 +++++++++++++++++++ tests/Countries/PeruTest.php | 18 +++++ 3 files changed, 128 insertions(+) create mode 100644 src/Countries/Peru.php create mode 100644 tests/.pest/snapshots/Countries/PeruTest/it_can_calculate_peru_holidays.snap create mode 100644 tests/Countries/PeruTest.php diff --git a/src/Countries/Peru.php b/src/Countries/Peru.php new file mode 100644 index 00000000..1c0f0b6c --- /dev/null +++ b/src/Countries/Peru.php @@ -0,0 +1,44 @@ + '01-01', + 'Día del Trabajo' => '05-01', + 'Batalla de Arica y Día de la bandera' => '06-07', + 'Día de San Pedro y San Pablo' => '06-29', + 'Día de la Fuerza Aérea del Perú' => '07-23', + 'Día de la Independencia' => '07-28', + 'Fiestas Patrias' => '07-29', + 'Batalla de Junín' => '08-06', + 'Santa Rosa de Lima' => '08-30', + 'Combate de Angamos' => '10-08', + 'Día de Todos los Santos' => '11-01', + 'Inmaculada Concepción' => '12-08', + 'Batalla de Ayacucho' => '12-09', + 'Navidad' => '12-25', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = $this->easter($year); + + return [ + 'Jueves Santo' => $easter->subDays(3), + 'Viernes Santo' => $easter->subDays(2), + ]; + } +} diff --git a/tests/.pest/snapshots/Countries/PeruTest/it_can_calculate_peru_holidays.snap b/tests/.pest/snapshots/Countries/PeruTest/it_can_calculate_peru_holidays.snap new file mode 100644 index 00000000..df38f061 --- /dev/null +++ b/tests/.pest/snapshots/Countries/PeruTest/it_can_calculate_peru_holidays.snap @@ -0,0 +1,66 @@ +[ + { + "name": "A\u00f1o nuevo", + "date": "2024-01-01" + }, + { + "name": "Jueves Santo", + "date": "2024-03-28" + }, + { + "name": "Viernes Santo", + "date": "2024-03-29" + }, + { + "name": "D\u00eda del Trabajo", + "date": "2024-05-01" + }, + { + "name": "Batalla de Arica y D\u00eda de la bandera", + "date": "2024-06-07" + }, + { + "name": "D\u00eda de San Pedro y San Pablo", + "date": "2024-06-29" + }, + { + "name": "D\u00eda de la Fuerza A\u00e9rea del Per\u00fa", + "date": "2024-07-23" + }, + { + "name": "D\u00eda de la Independencia", + "date": "2024-07-28" + }, + { + "name": "Fiestas Patrias", + "date": "2024-07-29" + }, + { + "name": "Batalla de Jun\u00edn", + "date": "2024-08-06" + }, + { + "name": "Santa Rosa de Lima", + "date": "2024-08-30" + }, + { + "name": "Combate de Angamos", + "date": "2024-10-08" + }, + { + "name": "D\u00eda de Todos los Santos", + "date": "2024-11-01" + }, + { + "name": "Inmaculada Concepci\u00f3n", + "date": "2024-12-08" + }, + { + "name": "Batalla de Ayacucho", + "date": "2024-12-09" + }, + { + "name": "Navidad", + "date": "2024-12-25" + } +] \ No newline at end of file diff --git a/tests/Countries/PeruTest.php b/tests/Countries/PeruTest.php new file mode 100644 index 00000000..aff6670e --- /dev/null +++ b/tests/Countries/PeruTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); From dcb66ef65feaae6c63c0390e904d107e3fe6494a Mon Sep 17 00:00:00 2001 From: Nick Dijkstra <3372841+ndijkstra@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:14:40 +0100 Subject: [PATCH 49/66] Update Dutch holidays (#67) * Remove "Oudejaarsdag" since it is not an official holiday * Use correct capitalization of holidays * Use Eerste and Tweede instead of 1e and 2e * Fix tests * Update capital letters in snapshot * Remove blank line EOF * Update it_can_calculate_dutch_holidays.snap --- src/Countries/Netherlands.php | 12 ++++++------ .../it_can_calculate_dutch_holidays.snap | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Countries/Netherlands.php b/src/Countries/Netherlands.php index 9c366ad5..44ae6ae7 100644 --- a/src/Countries/Netherlands.php +++ b/src/Countries/Netherlands.php @@ -16,8 +16,8 @@ protected function allHolidays(int $year): array return array_merge([ 'Nieuwjaarsdag' => '01-01', 'Bevrijdingsdag' => '05-05', - '1e Kerstdag' => '12-25', - '2e Kerstdag' => '12-26', + 'Eerste kerstdag' => '12-25', + 'Tweede kerstdag' => '12-26', ], $this->variableHolidays($year)); } @@ -36,11 +36,11 @@ protected function variableHolidays(int $year): array return [ 'Koningsdag' => $koningsDag, 'Goede Vrijdag' => $easter->subDays(2), - '1e Paasdag' => $easter, - '2e Paasdag' => $easter->addDay(), + 'Eerste paasdag' => $easter, + 'Tweede paasdag' => $easter->addDay(), 'Hemelvaartsdag' => $easter->addDays(39), - '1e Pinksterdag' => $easter->addDays(49), - '2e Pinksterdag' => $easter->addDays(50), + 'Eerste pinksterdag' => $easter->addDays(49), + 'Tweede pinksterdag' => $easter->addDays(50), ]; } } diff --git a/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap b/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap index 7ba840be..43bb5dfa 100644 --- a/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap +++ b/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap @@ -8,11 +8,11 @@ "date": "2024-03-29" }, { - "name": "1e Paasdag", + "name": "Eerste paasdag", "date": "2024-03-31" }, { - "name": "2e Paasdag", + "name": "Tweede paasdag", "date": "2024-04-01" }, { @@ -28,19 +28,19 @@ "date": "2024-05-09" }, { - "name": "1e Pinksterdag", + "name": "Eerste pinksterdag", "date": "2024-05-19" }, { - "name": "2e Pinksterdag", + "name": "Tweede pinksterdag", "date": "2024-05-20" }, { - "name": "1e Kerstdag", + "name": "Eerste kerstdag", "date": "2024-12-25" }, { - "name": "2e Kerstdag", + "name": "Tweede kerstdag", "date": "2024-12-26" } -] \ No newline at end of file +] From 78fe5938b54aaf55c7e7253897176510079d48ce Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:16:00 +0100 Subject: [PATCH 50/66] update NL snapshot --- .../it_can_calculate_ugandan_holidays.snap | 46 ------------------- .../it_can_calculate_dutch_holidays.snap | 2 +- 2 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 tests/.pest/snapshots/Countries/MalawiTest/it_can_calculate_ugandan_holidays.snap diff --git a/tests/.pest/snapshots/Countries/MalawiTest/it_can_calculate_ugandan_holidays.snap b/tests/.pest/snapshots/Countries/MalawiTest/it_can_calculate_ugandan_holidays.snap deleted file mode 100644 index 63bfa81d..00000000 --- a/tests/.pest/snapshots/Countries/MalawiTest/it_can_calculate_ugandan_holidays.snap +++ /dev/null @@ -1,46 +0,0 @@ -[ - { - "name": "New Years Day", - "date": "2024-01-01" - }, - { - "name": "John Chilembwe Day", - "date": "2024-01-15" - }, - { - "name": "Martyrs Day", - "date": "2024-03-03" - }, - { - "name": "Good Friday", - "date": "2024-03-29" - }, - { - "name": "Easter Monday", - "date": "2024-04-01" - }, - { - "name": "Labour Day", - "date": "2024-05-01" - }, - { - "name": "Kamuzu Day", - "date": "2024-05-14" - }, - { - "name": "Independence Day", - "date": "2024-07-06" - }, - { - "name": "Mothers Day", - "date": "2024-10-15" - }, - { - "name": "Christmas Day", - "date": "2024-12-25" - }, - { - "name": "Boxing Day", - "date": "2024-12-26" - } -] \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap b/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap index 43bb5dfa..13a3de79 100644 --- a/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap +++ b/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap @@ -43,4 +43,4 @@ "name": "Tweede kerstdag", "date": "2024-12-26" } -] +] \ No newline at end of file From 954ddcac2a3a83b8a8d0afbb1105a1ca964d6f64 Mon Sep 17 00:00:00 2001 From: Stavros Date: Tue, 23 Jan 2024 15:18:03 +0200 Subject: [PATCH 51/66] Greece only with default orthodoxEaster as other OrthodoxCountries --- src/Countries/Country.php | 4 +--- src/Countries/Greece.php | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Countries/Country.php b/src/Countries/Country.php index 6697d4c3..3a09768d 100644 --- a/src/Countries/Country.php +++ b/src/Countries/Country.php @@ -53,9 +53,7 @@ protected function orthodoxEaster(int $year): CarbonImmutable $timestamp = easter_date($year, CAL_EASTER_ALWAYS_JULIAN); $daysDifference = (int) ($year / 100) - (int) ($year / 400) - 2; - // Common orthodox easter date on all timezones - return CarbonImmutable::createFromTimestamp(strtotime("+$daysDifference days", $timestamp))->startOfDay()->addDay(); - //return CarbonImmutable::createFromTimestamp(strtotime("+$daysDifference days", $timestamp)); + return CarbonImmutable::createFromTimestamp(strtotime("+$daysDifference days", $timestamp)); } public static function find(string $countryCode): ?Country diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index 9f41be52..f6242839 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -31,28 +31,30 @@ protected function variableHolidays(int $year): array { // OrthodoxEaster needs to setTimezone $orthodoxEaster = $this->orthodoxEaster($year)->setTimezone("Europe/Athens"); + $cleanMonday = $orthodoxEaster->copy()->subDays(48); + $megaliParaskevi = $orthodoxEaster->copy()->subDays(2); + $megaloSavvato = $orthodoxEaster->copy()->subDays(1); + $deuteraPasha = $orthodoxEaster->copy()->addDay(); + $agiouPneumatos = $orthodoxEaster->copy()->addDays(50); + /** @var CarbonImmutable $protomagia */ $protomagia = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-05-01"); + $moveProtomagia = [$megaliParaskevi, $megaloSavvato, $orthodoxEaster, $deuteraPasha]; - if ( - $protomagia == $orthodoxEaster->subDays(2) || - $protomagia == $orthodoxEaster->subDays(1) || - $protomagia == $orthodoxEaster || - $protomagia == $orthodoxEaster->addDay() - ) { - $protomagia = $orthodoxEaster->addDays(2); + if ( in_array($protomagia, $moveProtomagia) ) { + $protomagia = $orthodoxEaster->copy()->addDays(2); } if ($protomagia->isSunday()) { - $protomagia = $protomagia->addDay(); + $protomagia = $protomagia->copy()->addDay(); } return [ - 'Καθαρά Δευτέρα' => $orthodoxEaster->subDays(48), //always Monday + 'Καθαρά Δευτέρα' => $cleanMonday, //always Monday 'Πρωτομαγιά' => $protomagia, - 'Μεγάλη Παρασκευή' => $orthodoxEaster->subDays(2), + 'Μεγάλη Παρασκευή' => $megaliParaskevi, 'Κυριακή του Πάσχα' => $orthodoxEaster, - 'Δευτέρα του Πάσχα' => $orthodoxEaster->addDay(), - 'Αγίου Πνεύματος' => $orthodoxEaster->addDays(50), //always Monday + 'Δευτέρα του Πάσχα' => $deuteraPasha, + 'Αγίου Πνεύματος' => $agiouPneumatos, //always Monday ]; } } \ No newline at end of file From 262bfa5887357cfb3f11bec3ba016f39b2b4e13d Mon Sep 17 00:00:00 2001 From: Petr Katerinak <33215381+inDeev@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:27:41 +0100 Subject: [PATCH 52/66] Added historical data for Czechia (#159) Co-authored-by: Petr Katerinak --- src/Countries/Czechia.php | 63 ++++++++++++++----- .../it_can_calculate_czech_holidays.snap | 2 +- tests/Countries/CzechiaTest.php | 54 ++++++++++++++++ 3 files changed, 102 insertions(+), 17 deletions(-) diff --git a/src/Countries/Czechia.php b/src/Countries/Czechia.php index c4aff420..e1392128 100644 --- a/src/Countries/Czechia.php +++ b/src/Countries/Czechia.php @@ -13,19 +13,43 @@ public function countryCode(): string protected function allHolidays(int $year): array { - return array_merge([ - 'Den obnovy samostatného českého státu' => '01-01', - 'Svátek práce' => '05-01', - 'Den vítězství' => '05-08', - 'Den slovanských věrozvěstů Cyrila a Metoděje' => '07-05', - 'Den upálení mistra Jana Husa' => '07-06', - 'Den české státnosti' => '09-28', - 'Den vzniku samostatného československého státu' => '10-28', - 'Den boje za svobodu a demokracii a Mezinárodní den studentstva' => '11-17', - 'Štědrý den' => '12-24', - '1. svátek vánoční' => '12-25', - '2. svátek vánoční' => '12-26', - ], $this->variableHolidays($year)); + // https://kalendar.beda.cz/statni-svatky-a-vyznamne-dny-v-roce-prehledne?year=1970 + $holidays = [ + 'Nový rok' => ['01-01', $year <= 2000], + 'Nový rok; Den obnovy samostatného českého státu' => ['01-01', $year >= 2001], + + 'Svátek práce' => ['05-01', true], + + 'Výročí osvobození Československa Sovětskou armádou' => ['05-09', $year <= 1990], + 'Den osvobození od fašismu' => [$year === 1991 ? '05-09' : '05-08' , $year >= 1991 && $year <= 2000], + 'Den osvobození' => ['05-08', $year >= 2001 && $year <= 2003], + 'Den vítězství' => ['05-08', $year >= 2004], + + 'Den slovanských věrozvěstů Cyrila a Metoděje' => ['07-05', $year >= 1990], + + 'Den upálení mistra Jana Husa' => ['07-06', $year >= 1990], + + 'Den české státnosti' => ['09-28', $year >= 2000], + + 'Vyhlášení samostatnosti ČSR; Schválení zákona o federaci' => ['10-28', $year <= 1971], + 'Den znárodnění' => ['10-28', $year === 1972], + 'Vyhlášení samostatnosti ČSR; Schválení zákona o federaci; Den znárodnění' => ['10-28', $year >= 1973 && $year <= 1974], + 'Den vzniku samostatného československého státu' => ['10-28', $year >= 1988], + + 'Den boje za svobodu a demokracii a Mezinárodní den studentstva' => ['11-17', $year >= 2000], + 'Štědrý den' => ['12-24', $year >= 1990], + '1. svátek vánoční' => ['12-25', true], + '2. svátek vánoční' => ['12-26', true], + ]; + + $filteredHolidays = array_map( + static fn (array $holiday) => $holiday[0], + array_filter($holidays, + static fn (array $holiday) => $holiday[1] === true + ) + ); + + return array_merge($filteredHolidays, $this->variableHolidays($year)); } /** @return array */ @@ -33,9 +57,16 @@ protected function variableHolidays(int $year): array { $easter = $this->easter($year); - return [ - 'Velikonoční pondělí' => $easter->addDay(), - 'Velký pátek' => $easter->subDays(2), + $variableHolidays = [ + 'Velikonoční pondělí' => [$easter->addDay(), true], + 'Velký pátek' => [$easter->subDays(2), $year >= 2016], ]; + + return array_map( + static fn (array $variableHoliday) => $variableHoliday[0], + array_filter($variableHolidays, + static fn (array $variableHoliday) => $variableHoliday[1] === true + ) + ); } } diff --git a/tests/.pest/snapshots/Countries/CzechiaTest/it_can_calculate_czech_holidays.snap b/tests/.pest/snapshots/Countries/CzechiaTest/it_can_calculate_czech_holidays.snap index 9e3ba56a..77ae5112 100644 --- a/tests/.pest/snapshots/Countries/CzechiaTest/it_can_calculate_czech_holidays.snap +++ b/tests/.pest/snapshots/Countries/CzechiaTest/it_can_calculate_czech_holidays.snap @@ -1,6 +1,6 @@ [ { - "name": "Den obnovy samostatn\u00e9ho \u010desk\u00e9ho st\u00e1tu", + "name": "Nov\u00fd rok; Den obnovy samostatn\u00e9ho \u010desk\u00e9ho st\u00e1tu", "date": "2024-01-01" }, { diff --git a/tests/Countries/CzechiaTest.php b/tests/Countries/CzechiaTest.php index 0a7ece2f..4616cbcb 100644 --- a/tests/Countries/CzechiaTest.php +++ b/tests/Countries/CzechiaTest.php @@ -16,3 +16,57 @@ expect(formatDates($holidays))->toMatchSnapshot(); }); + +it ('gives right holidays for specific years', function (int $year, array $containsHolidays) { + $holidays = Holidays::for('cz', $year)->get(); + + $allHolidaysSince1970 = [ + 0 => 'Nový rok', + 1 => 'Nový rok; Den obnovy samostatného českého státu', + 2 => 'Svátek práce', + 3 => 'Výročí osvobození Československa Sovětskou armádou', + 4 => 'Den osvobození od fašismu', + 5 => 'Den osvobození', + 6 => 'Den vítězství', + 7 => 'Den slovanských věrozvěstů Cyrila a Metoděje', + 8 => 'Den upálení mistra Jana Husa', + 9 => 'Den české státnosti', + 10 => 'Vyhlášení samostatnosti ČSR; Schválení zákona o federaci', + 11 => 'Den znárodnění', + 12 => 'Vyhlášení samostatnosti ČSR; Schválení zákona o federaci; Den znárodnění', + 13 => 'Den vzniku samostatného československého státu', + 14 => 'Den boje za svobodu a demokracii a Mezinárodní den studentstva', + 15 => 'Štědrý den', + 16 => '1. svátek vánoční', + 17 => '2. svátek vánoční', + // Variable: + 18 => 'Velikonoční pondělí', + 19 => 'Velký pátek', + ]; + + expect($holidays)->toBeArray(); + + $expectedHolidays = array_map( + static fn (int $index) => $allHolidaysSince1970[$index], + $containsHolidays + ); + + $givenNames = array_map( + static fn (array $holidayProperties) => $holidayProperties['name'], + $holidays + ); + + expect($givenNames)->toEqualCanonicalizing($expectedHolidays); +})->with([ + [1970, [0, 18, 2, 3, 10, 16, 17]], + [1975, [0, 18, 2, 3, 16, 17]], + [1980, [0, 18, 2, 3, 16, 17]], + [1985, [0, 18, 2, 3, 16, 17]], + [1990, [0, 18, 2, 3, 7, 8, 13, 15, 16, 17]], + [1995, [0, 18, 2, 4, 7, 8, 13, 15, 16, 17]], + [2000, [0, 18, 2, 4, 7, 8, 9, 13, 14, 15, 16, 17]], + [2005, [1, 18, 2, 6, 7, 8, 9, 13, 14, 15, 16, 17]], + [2010, [1, 18, 2, 6, 7, 8, 9, 13, 14, 15, 16, 17]], + [2015, [1, 18, 2, 6, 7, 8, 9, 13, 14, 15, 16, 17]], + [2020, [1, 19, 18, 2, 6, 7, 8, 9, 13, 14, 15, 16, 17]], +]); \ No newline at end of file From fe37e447a3671f565b00345c4909d4445e0a6abc Mon Sep 17 00:00:00 2001 From: Nielsvanpach Date: Tue, 23 Jan 2024 13:28:01 +0000 Subject: [PATCH 53/66] Fix styling --- src/Countries/Czechia.php | 2 +- tests/Countries/CzechiaTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Countries/Czechia.php b/src/Countries/Czechia.php index e1392128..402aed2d 100644 --- a/src/Countries/Czechia.php +++ b/src/Countries/Czechia.php @@ -21,7 +21,7 @@ protected function allHolidays(int $year): array 'Svátek práce' => ['05-01', true], 'Výročí osvobození Československa Sovětskou armádou' => ['05-09', $year <= 1990], - 'Den osvobození od fašismu' => [$year === 1991 ? '05-09' : '05-08' , $year >= 1991 && $year <= 2000], + 'Den osvobození od fašismu' => [$year === 1991 ? '05-09' : '05-08', $year >= 1991 && $year <= 2000], 'Den osvobození' => ['05-08', $year >= 2001 && $year <= 2003], 'Den vítězství' => ['05-08', $year >= 2004], diff --git a/tests/Countries/CzechiaTest.php b/tests/Countries/CzechiaTest.php index 4616cbcb..5b9f09bb 100644 --- a/tests/Countries/CzechiaTest.php +++ b/tests/Countries/CzechiaTest.php @@ -17,7 +17,7 @@ expect(formatDates($holidays))->toMatchSnapshot(); }); -it ('gives right holidays for specific years', function (int $year, array $containsHolidays) { +it('gives right holidays for specific years', function (int $year, array $containsHolidays) { $holidays = Holidays::for('cz', $year)->get(); $allHolidaysSince1970 = [ @@ -69,4 +69,4 @@ [2010, [1, 18, 2, 6, 7, 8, 9, 13, 14, 15, 16, 17]], [2015, [1, 18, 2, 6, 7, 8, 9, 13, 14, 15, 16, 17]], [2020, [1, 19, 18, 2, 6, 7, 8, 9, 13, 14, 15, 16, 17]], -]); \ No newline at end of file +]); From 71169b8b1fc4832ddcf30030b3a27d7c57a14a74 Mon Sep 17 00:00:00 2001 From: freekmurze Date: Tue, 23 Jan 2024 14:28:59 +0000 Subject: [PATCH 54/66] Fix styling --- src/Countries/Greece.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index f6242839..1b206e00 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -14,13 +14,13 @@ public function countryCode(): string protected function allHolidays(int $year): array { return array_merge([ - 'Πρωτοχρονιά' => '01-01', - 'Θεοφάνια' => '01-06', - '25η Μαρτίου' => '03-25', - 'Πρωτομαγιά' => '05-01', - 'Δεκαπενταύγουστος' => '08-15', - '28η Οκτωβρίου' => '10-28', - 'Χριστούγεννα' => '12-25', + 'Πρωτοχρονιά' => '01-01', + 'Θεοφάνια' => '01-06', + '25η Μαρτίου' => '03-25', + 'Πρωτομαγιά' => '05-01', + 'Δεκαπενταύγουστος' => '08-15', + '28η Οκτωβρίου' => '10-28', + 'Χριστούγεννα' => '12-25', 'Σύναξη της Θεοτόκου' => '12-26', ], $this->variableHolidays($year)); @@ -30,7 +30,7 @@ protected function allHolidays(int $year): array protected function variableHolidays(int $year): array { // OrthodoxEaster needs to setTimezone - $orthodoxEaster = $this->orthodoxEaster($year)->setTimezone("Europe/Athens"); + $orthodoxEaster = $this->orthodoxEaster($year)->setTimezone('Europe/Athens'); $cleanMonday = $orthodoxEaster->copy()->subDays(48); $megaliParaskevi = $orthodoxEaster->copy()->subDays(2); $megaloSavvato = $orthodoxEaster->copy()->subDays(1); @@ -41,7 +41,7 @@ protected function variableHolidays(int $year): array $protomagia = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-05-01"); $moveProtomagia = [$megaliParaskevi, $megaloSavvato, $orthodoxEaster, $deuteraPasha]; - if ( in_array($protomagia, $moveProtomagia) ) { + if (in_array($protomagia, $moveProtomagia)) { $protomagia = $orthodoxEaster->copy()->addDays(2); } if ($protomagia->isSunday()) { @@ -49,12 +49,12 @@ protected function variableHolidays(int $year): array } return [ - 'Καθαρά Δευτέρα' => $cleanMonday, //always Monday - 'Πρωτομαγιά' => $protomagia, - 'Μεγάλη Παρασκευή' => $megaliParaskevi, + 'Καθαρά Δευτέρα' => $cleanMonday, //always Monday + 'Πρωτομαγιά' => $protomagia, + 'Μεγάλη Παρασκευή' => $megaliParaskevi, 'Κυριακή του Πάσχα' => $orthodoxEaster, 'Δευτέρα του Πάσχα' => $deuteraPasha, - 'Αγίου Πνεύματος' => $agiouPneumatos, //always Monday + 'Αγίου Πνεύματος' => $agiouPneumatos, //always Monday ]; } -} \ No newline at end of file +} From 4d4039690bfc38694ce68c4fd0067907effe80b7 Mon Sep 17 00:00:00 2001 From: freekmurze Date: Tue, 23 Jan 2024 14:29:29 +0000 Subject: [PATCH 55/66] Fix styling --- src/Countries/Kosovo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Countries/Kosovo.php b/src/Countries/Kosovo.php index 87dfcc2f..0c2ba0d1 100644 --- a/src/Countries/Kosovo.php +++ b/src/Countries/Kosovo.php @@ -30,7 +30,7 @@ protected function variableHolidays(int $year): array $holidays['Pashkët Katolike'] = $this->easter($year); $holidays['Pashkët Ortodokse'] = $this->orthodoxEaster($year); - if($year >= 2008) { + if ($year >= 2008) { $holidays['Dita e Pavarësisë së Republikës së Kosovës'] = '02-17'; $holidays['Dita e Kushtetutës së Republikës së Kosovës'] = '04-09'; } From 586ad9f3339bb2ff4fe0d81d9b7acae5077f8186 Mon Sep 17 00:00:00 2001 From: freekmurze Date: Tue, 23 Jan 2024 14:30:15 +0000 Subject: [PATCH 56/66] Fix styling --- src/Countries/Panama.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Countries/Panama.php b/src/Countries/Panama.php index 04f3c54d..98e10eb1 100644 --- a/src/Countries/Panama.php +++ b/src/Countries/Panama.php @@ -69,8 +69,8 @@ protected function variableHolidays(int $year): array * established for a national celebration to coincide with a Sunday, the following Monday * will be enabled as a mandatory weekly rest day" * - * @param array $fixedHolidays Array of holidays in the format ['holiday name' => 'mm-dd'] - * @param int $year The year for which to calculate the holidays + * @param array $fixedHolidays Array of holidays in the format ['holiday name' => 'mm-dd'] + * @param int $year The year for which to calculate the holidays * @return array */ protected function calculateBridgeDays(array $fixedHolidays, int $year): array @@ -83,7 +83,7 @@ protected function calculateBridgeDays(array $fixedHolidays, int $year): array if ($holiday !== false) { $holidays[$name] = $holiday; if ($holiday->isSunday()) { - $holidays[$name . ' (Puente)'] = $holiday->addDay(); + $holidays[$name.' (Puente)'] = $holiday->addDay(); } } } From 65a0cd15685b48692c41c6bade9918cd5d15f953 Mon Sep 17 00:00:00 2001 From: freekmurze Date: Tue, 23 Jan 2024 14:33:12 +0000 Subject: [PATCH 57/66] Fix styling --- src/Countries/Canada.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Countries/Canada.php b/src/Countries/Canada.php index c7efc9e2..1925fb2c 100644 --- a/src/Countries/Canada.php +++ b/src/Countries/Canada.php @@ -16,21 +16,21 @@ protected function allHolidays(int $year): array { return array_merge( [ - 'New Year\'s Day' => new CarbonImmutable($year . "-01-01", 'America/Toronto'), - 'Canada Day' => new CarbonImmutable($year . "-07-01", 'America/Toronto'), + 'New Year\'s Day' => new CarbonImmutable($year.'-01-01', 'America/Toronto'), + 'Canada Day' => new CarbonImmutable($year.'-07-01', 'America/Toronto'), 'Civic Holiday' => new CarbonImmutable( - "first monday of August " . $year, 'America/Toronto' + 'first monday of August '.$year, 'America/Toronto' ), 'Labour Day' => new CarbonImmutable( - "first monday of September " . $year, 'America/Toronto' + 'first monday of September '.$year, 'America/Toronto' ), 'National Day for Truth and Reconciliation' => new CarbonImmutable( - $year . "-09-30", + $year.'-09-30', 'America/Toronto' ), - 'Remembrance Day' => new CarbonImmutable($year . "-11-11", 'America/Toronto'), - 'Christmas Day' => new CarbonImmutable($year . "-12-25", 'America/Toronto'), - 'Boxing Day' => new CarbonImmutable($year . '-12-26', 'America/Toronto'), + 'Remembrance Day' => new CarbonImmutable($year.'-11-11', 'America/Toronto'), + 'Christmas Day' => new CarbonImmutable($year.'-12-25', 'America/Toronto'), + 'Boxing Day' => new CarbonImmutable($year.'-12-26', 'America/Toronto'), ], $this->variableHolidays($year) ); @@ -51,6 +51,7 @@ protected function variableHolidays(int $year): array } $thanksgiving = new CarbonImmutable("second monday of October $year", 'America/Toronto'); + return [ 'Victoria Day' => $victoriaDay, 'Good Friday' => $goodFriday, From 9f45e43b48848ad2276174f9419a781b7906ea07 Mon Sep 17 00:00:00 2001 From: freekmurze Date: Tue, 23 Jan 2024 14:34:33 +0000 Subject: [PATCH 58/66] Fix styling --- src/Countries/Turkmenistan.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Countries/Turkmenistan.php b/src/Countries/Turkmenistan.php index 11004160..18cb3a66 100644 --- a/src/Countries/Turkmenistan.php +++ b/src/Countries/Turkmenistan.php @@ -5,12 +5,11 @@ use Carbon\CarbonImmutable; use DateTime; use DateTimeZone; -use DateInterval; use IntlDateFormatter; class Turkmenistan extends Country { - protected string $timezone = "Asia/Ashgabat"; + protected string $timezone = 'Asia/Ashgabat'; public function countryCode(): string { @@ -47,7 +46,7 @@ protected function islamicCalendar(string $input, int $year, $nextYear = false): $hijriYear = $this->getHijriYear(year: $year, nextYear: $nextYear); $formatter = $this->getIslamicFormatter(); - $timeStamp = $formatter->parse($input . '/' . $hijriYear . ' AH'); + $timeStamp = $formatter->parse($input.'/'.$hijriYear.' AH'); $dateTime = date_create()->setTimeStamp($timeStamp)->setTimezone(new DateTimeZone($this->timezone)); return $dateTime->format('m-d'); @@ -68,7 +67,7 @@ protected function getHijriYear(int $year, $nextYear = false): int { $formatter = $this->getIslamicFormatter(); $formatter->setPattern('yyyy'); - $dateTime = DateTime::createFromFormat('d/m/Y', '01/01/' . ($nextYear ? $year + 1 : $year)); + $dateTime = DateTime::createFromFormat('d/m/Y', '01/01/'.($nextYear ? $year + 1 : $year)); return (int) $formatter->format($dateTime); } From f2514d60fcd8fd20951afe48a98bdedacdefd618 Mon Sep 17 00:00:00 2001 From: freekmurze Date: Tue, 23 Jan 2024 14:35:32 +0000 Subject: [PATCH 59/66] Update CHANGELOG --- CHANGELOG.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cdd8fd1..14dc7526 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,55 @@ All notable changes to `holidays` will be documented in this file. +## 1.2.0 - 2024-01-23 + +### What's Changed + +* Added Dominican Republic holidays by @KiritoXD01 in https://github.com/spatie/holidays/pull/57 +* Added pint package by @thecaliskan in https://github.com/spatie/holidays/pull/149 +* Polish holidays by @srsbiz in https://github.com/spatie/holidays/pull/154 +* Add Support for Liechtenstein by @Martin-Welte in https://github.com/spatie/holidays/pull/33 +* test: update liechtenstein snapshot by @Martin-Welte in https://github.com/spatie/holidays/pull/164 +* Added Haiti holidays by @ivanmercedes in https://github.com/spatie/holidays/pull/148 +* Add Romanian Holidays by @florinp in https://github.com/spatie/holidays/pull/27 +* Add Guatemala holidays by @ejchiroy in https://github.com/spatie/holidays/pull/106 +* Add holidays for Luxembourg by @UrbinCedric in https://github.com/spatie/holidays/pull/165 +* Add holidays for South Africa by @pierredup in https://github.com/spatie/holidays/pull/30 +* Add Peru holidays by @dlopez525 in https://github.com/spatie/holidays/pull/54 +* Update Dutch holidays by @ndijkstra in https://github.com/spatie/holidays/pull/67 +* Added historical data for Czechia by @inDeev in https://github.com/spatie/holidays/pull/159 +* Add Greece holidays by @lowv-developer in https://github.com/spatie/holidays/pull/114 +* Add 🇽🇰Kosovo🇽🇰 Holidays by @AvdylKrasniqi in https://github.com/spatie/holidays/pull/151 +* Feature/add panama holidays by @amitsamtani in https://github.com/spatie/holidays/pull/147 +* Add Norway Holidays by @Tor2r in https://github.com/spatie/holidays/pull/105 +* Add Lithuanian holidays by @eimantaaas in https://github.com/spatie/holidays/pull/163 +* Add Canadian Holidays by @thinkstylestudio in https://github.com/spatie/holidays/pull/41 +* Add Turkmenistan Holidays by @kakajansh in https://github.com/spatie/holidays/pull/96 + +### New Contributors + +* @KiritoXD01 made their first contribution in https://github.com/spatie/holidays/pull/57 +* @thecaliskan made their first contribution in https://github.com/spatie/holidays/pull/149 +* @srsbiz made their first contribution in https://github.com/spatie/holidays/pull/154 +* @Martin-Welte made their first contribution in https://github.com/spatie/holidays/pull/33 +* @ivanmercedes made their first contribution in https://github.com/spatie/holidays/pull/148 +* @florinp made their first contribution in https://github.com/spatie/holidays/pull/27 +* @ejchiroy made their first contribution in https://github.com/spatie/holidays/pull/106 +* @UrbinCedric made their first contribution in https://github.com/spatie/holidays/pull/165 +* @pierredup made their first contribution in https://github.com/spatie/holidays/pull/30 +* @dlopez525 made their first contribution in https://github.com/spatie/holidays/pull/54 +* @ndijkstra made their first contribution in https://github.com/spatie/holidays/pull/67 +* @inDeev made their first contribution in https://github.com/spatie/holidays/pull/159 +* @lowv-developer made their first contribution in https://github.com/spatie/holidays/pull/114 +* @AvdylKrasniqi made their first contribution in https://github.com/spatie/holidays/pull/151 +* @amitsamtani made their first contribution in https://github.com/spatie/holidays/pull/147 +* @Tor2r made their first contribution in https://github.com/spatie/holidays/pull/105 +* @eimantaaas made their first contribution in https://github.com/spatie/holidays/pull/163 +* @thinkstylestudio made their first contribution in https://github.com/spatie/holidays/pull/41 +* @kakajansh made their first contribution in https://github.com/spatie/holidays/pull/96 + +**Full Changelog**: https://github.com/spatie/holidays/compare/1.1.0...1.2.0 + ## 1.1.0 - 2024-01-19 ### What's Changed From faf0451c97f71a58b3420b881599a87a6822eb42 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:41:10 +0100 Subject: [PATCH 60/66] phpstan fixes --- phpstan-baseline.neon | 10 ++++++++++ src/Countries/Turkmenistan.php | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 46ce0ede..d237ce63 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -25,6 +25,16 @@ parameters: count: 1 path: src/Countries/Country.php + - + message: "#^Cannot call method setTimeStamp\\(\\) on DateTime\\|false\\.$#" + count: 1 + path: src/Countries/Turkmenistan.php + + - + message: "#^Parameter \\#1 \\$datetime of method IntlDateFormatter\\:\\:format\\(\\) expects array\\|DateTimeInterface\\|float\\|int\\|IntlCalendar\\|string, DateTime\\|false given\\.$#" + count: 1 + path: src/Countries/Turkmenistan.php + - message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(Carbon\\\\CarbonImmutable\\)\\: mixed\\)\\|null, Closure\\(string\\)\\: non\\-falsy\\-string given\\.$#" count: 1 diff --git a/src/Countries/Turkmenistan.php b/src/Countries/Turkmenistan.php index 18cb3a66..b9bf8b33 100644 --- a/src/Countries/Turkmenistan.php +++ b/src/Countries/Turkmenistan.php @@ -30,7 +30,7 @@ protected function allHolidays(int $year): array ], $this->variableHolidays($year)); } - /** @return array */ + /** @return array */ protected function variableHolidays(int $year): array { return [ @@ -41,7 +41,7 @@ protected function variableHolidays(int $year): array ]; } - protected function islamicCalendar(string $input, int $year, $nextYear = false): string + protected function islamicCalendar(string $input, int $year, bool $nextYear = false): string { $hijriYear = $this->getHijriYear(year: $year, nextYear: $nextYear); $formatter = $this->getIslamicFormatter(); @@ -63,7 +63,7 @@ protected function getIslamicFormatter(): IntlDateFormatter ); } - protected function getHijriYear(int $year, $nextYear = false): int + protected function getHijriYear(int $year, bool $nextYear = false): int { $formatter = $this->getIslamicFormatter(); $formatter->setPattern('yyyy'); From 6455e422bc9d8522c945a7c0039957c3b48372d1 Mon Sep 17 00:00:00 2001 From: Nielsvanpach Date: Tue, 23 Jan 2024 14:41:31 +0000 Subject: [PATCH 61/66] Fix styling --- src/Countries/Turkmenistan.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Countries/Turkmenistan.php b/src/Countries/Turkmenistan.php index b9bf8b33..cd207609 100644 --- a/src/Countries/Turkmenistan.php +++ b/src/Countries/Turkmenistan.php @@ -2,7 +2,6 @@ namespace Spatie\Holidays\Countries; -use Carbon\CarbonImmutable; use DateTime; use DateTimeZone; use IntlDateFormatter; From 18f71ca0e0d2a635e8366e0b49b9963de6c517d4 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:43:31 +0100 Subject: [PATCH 62/66] fix tests for Canada --- src/Countries/Canada.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Countries/Canada.php b/src/Countries/Canada.php index 1925fb2c..52ea0e95 100644 --- a/src/Countries/Canada.php +++ b/src/Countries/Canada.php @@ -11,7 +11,6 @@ public function countryCode(): string return 'ca'; } - /** @return array */ protected function allHolidays(int $year): array { return array_merge( @@ -39,11 +38,10 @@ protected function allHolidays(int $year): array /** @return array */ protected function variableHolidays(int $year): array { - $easterSunday = CarbonImmutable::createFromTimestamp(easter_date($year)) - ->setTimezone('America/Toronto'); + $easter = $this->easter($year); - $goodFriday = $easterSunday->subDays(2); - $easterMonday = $easterSunday->addDays(1); + $goodFriday = $easter->subDays(2); + $easterMonday = $easter->addDay(); $victoriaDay = new CarbonImmutable("last monday of May $year", 'America/Toronto'); if ($victoriaDay->day < 25) { From 437a90a8a4208b79892334376a6cb6f0c90e8d16 Mon Sep 17 00:00:00 2001 From: Peter Khomyn Date: Tue, 23 Jan 2024 16:44:53 +0200 Subject: [PATCH 63/66] Add Ukrainian holidays (#112) * Add Ukrainian Holidays * correct country code * correct country code * Update Ukraine.php --- src/Countries/Ukraine.php | 39 ++++++++++++++++ .../it_can_calculate_ukrainian_holidays.snap | 46 +++++++++++++++++++ tests/Countries/UkraineTest.php | 19 ++++++++ 3 files changed, 104 insertions(+) create mode 100644 src/Countries/Ukraine.php create mode 100644 tests/.pest/snapshots/Countries/UkraineTest/it_can_calculate_ukrainian_holidays.snap create mode 100644 tests/Countries/UkraineTest.php diff --git a/src/Countries/Ukraine.php b/src/Countries/Ukraine.php new file mode 100644 index 00000000..0342bec0 --- /dev/null +++ b/src/Countries/Ukraine.php @@ -0,0 +1,39 @@ + '01-01', + 'Міжнародний жіночий день' => '03-08', + 'День праці' => '05-01', + 'День пам\'яті та перемоги над нацизмом у Другій світовій війні 1939 – 1945 років' => '05-08', + 'День Конституції України' => '06-28', + 'День Української Державності' => '07-15', + 'День Незалежності України' => '08-24', + 'День захисників і захисниць України' => '10-01', + 'Різдво Христове' => '12-25', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = $this->orthodoxEaster($year); + + return [ + 'Великодній Понеділок' => $easter->addDay(), + 'Трійця' => $easter->addDays(50), + ]; + } +} \ No newline at end of file diff --git a/tests/.pest/snapshots/Countries/UkraineTest/it_can_calculate_ukrainian_holidays.snap b/tests/.pest/snapshots/Countries/UkraineTest/it_can_calculate_ukrainian_holidays.snap new file mode 100644 index 00000000..2539a9ca --- /dev/null +++ b/tests/.pest/snapshots/Countries/UkraineTest/it_can_calculate_ukrainian_holidays.snap @@ -0,0 +1,46 @@ +[ + { + "name": "\u041d\u043e\u0432\u0438\u0439 \u0420\u0456\u043a", + "date": "2024-01-01" + }, + { + "name": "\u041c\u0456\u0436\u043d\u0430\u0440\u043e\u0434\u043d\u0438\u0439 \u0436\u0456\u043d\u043e\u0447\u0438\u0439 \u0434\u0435\u043d\u044c", + "date": "2024-03-08" + }, + { + "name": "\u0414\u0435\u043d\u044c \u043f\u0440\u0430\u0446\u0456", + "date": "2024-05-01" + }, + { + "name": "\u0412\u0435\u043b\u0438\u043a\u043e\u0434\u043d\u0456\u0439 \u041f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a", + "date": "2024-05-06" + }, + { + "name": "\u0414\u0435\u043d\u044c \u043f\u0430\u043c'\u044f\u0442\u0456 \u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u043e\u0433\u0438 \u043d\u0430\u0434 \u043d\u0430\u0446\u0438\u0437\u043c\u043e\u043c \u0443 \u0414\u0440\u0443\u0433\u0456\u0439 \u0441\u0432\u0456\u0442\u043e\u0432\u0456\u0439 \u0432\u0456\u0439\u043d\u0456 1939 \u2013 1945 \u0440\u043e\u043a\u0456\u0432", + "date": "2024-05-08" + }, + { + "name": "\u0422\u0440\u0456\u0439\u0446\u044f", + "date": "2024-06-24" + }, + { + "name": "\u0414\u0435\u043d\u044c \u041a\u043e\u043d\u0441\u0442\u0438\u0442\u0443\u0446\u0456\u0457 \u0423\u043a\u0440\u0430\u0457\u043d\u0438", + "date": "2024-06-28" + }, + { + "name": "\u0414\u0435\u043d\u044c \u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u043e\u0457 \u0414\u0435\u0440\u0436\u0430\u0432\u043d\u043e\u0441\u0442\u0456", + "date": "2024-07-15" + }, + { + "name": "\u0414\u0435\u043d\u044c \u041d\u0435\u0437\u0430\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u0456 \u0423\u043a\u0440\u0430\u0457\u043d\u0438", + "date": "2024-08-24" + }, + { + "name": "\u0414\u0435\u043d\u044c \u0437\u0430\u0445\u0438\u0441\u043d\u0438\u043a\u0456\u0432 \u0456 \u0437\u0430\u0445\u0438\u0441\u043d\u0438\u0446\u044c \u0423\u043a\u0440\u0430\u0457\u043d\u0438", + "date": "2024-10-01" + }, + { + "name": "\u0420\u0456\u0437\u0434\u0432\u043e \u0425\u0440\u0438\u0441\u0442\u043e\u0432\u0435", + "date": "2024-12-25" + } +] \ No newline at end of file diff --git a/tests/Countries/UkraineTest.php b/tests/Countries/UkraineTest.php new file mode 100644 index 00000000..117a035c --- /dev/null +++ b/tests/Countries/UkraineTest.php @@ -0,0 +1,19 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +}); \ No newline at end of file From b2d0cbf1a5b249d3c5bb059d48970ed16271e05f Mon Sep 17 00:00:00 2001 From: Nielsvanpach Date: Tue, 23 Jan 2024 14:45:13 +0000 Subject: [PATCH 64/66] Fix styling --- src/Countries/Ukraine.php | 2 +- tests/Countries/UkraineTest.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Countries/Ukraine.php b/src/Countries/Ukraine.php index 0342bec0..8c45f28a 100644 --- a/src/Countries/Ukraine.php +++ b/src/Countries/Ukraine.php @@ -36,4 +36,4 @@ protected function variableHolidays(int $year): array 'Трійця' => $easter->addDays(50), ]; } -} \ No newline at end of file +} diff --git a/tests/Countries/UkraineTest.php b/tests/Countries/UkraineTest.php index 117a035c..04e9b311 100644 --- a/tests/Countries/UkraineTest.php +++ b/tests/Countries/UkraineTest.php @@ -3,7 +3,6 @@ namespace Spatie\Holidays\Tests\Countries; use Carbon\CarbonImmutable; -use Spatie\Holidays\Countries\Austria; use Spatie\Holidays\Holidays; it('can calculate ukrainian holidays', function () { @@ -16,4 +15,4 @@ ->not()->toBeEmpty(); expect(formatDates($holidays))->toMatchSnapshot(); -}); \ No newline at end of file +}); From 9aa2b302b5243363e52618897432f1120650702e Mon Sep 17 00:00:00 2001 From: thecaliskan Date: Tue, 23 Jan 2024 19:04:14 +0300 Subject: [PATCH 65/66] Added has helper --- README.md | 11 +++++++++++ src/Holidays.php | 5 +++++ tests/HolidaysTest.php | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/README.md b/README.md index 8bc3564e..714dbff0 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,17 @@ use Spatie\Holidays\Holidays; Holidays::for('be')->getName('2024-01-01'); // Nieuwjaar ``` +### Determining whether a country is supported + +If you need to check a country supported, you can use the `has` method. + +```php +use Spatie\Holidays\Holidays; + +Holidays::has('be'); // true +Holidays::has('unknown'); // false +``` + ### Package limitations 1. Islamic holidays are not supported (yet) diff --git a/src/Holidays.php b/src/Holidays.php index 775592df..8b530b0b 100755 --- a/src/Holidays.php +++ b/src/Holidays.php @@ -28,6 +28,11 @@ public static function for(Country|string $country, ?int $year = null): static return new static($country, $year); } + public static function has(string $country): bool + { + return Country::find($country) instanceof Country; + } + /** @return array */ public function get(Country|string|null $country = null, ?int $year = null): array { diff --git a/tests/HolidaysTest.php b/tests/HolidaysTest.php index 2477e605..aa242162 100644 --- a/tests/HolidaysTest.php +++ b/tests/HolidaysTest.php @@ -83,3 +83,11 @@ $result = Holidays::for('be')->getName(CarbonImmutable::parse('2024-01-02')); expect($result)->toBeNull(); }); + +it('can get the country is supported', function () { + $result = Holidays::has(country: 'be'); + expect($result)->toBeTrue(); + + $result = Holidays::has(country: 'unknown'); + expect($result)->toBeFalse(); +}); From e932a2d5ac9c4ccdf2ccfff6fec07cde88965bc9 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:28:16 +0100 Subject: [PATCH 66/66] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 714dbff0..92128dde 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Holidays::for('be')->getName('2024-01-01'); // Nieuwjaar ### Determining whether a country is supported -If you need to check a country supported, you can use the `has` method. +To verify whether a country is supported, you can use the `has` method. ```php use Spatie\Holidays\Holidays;