From 639fc1a6416e3d4234e9dcf660a5d71745a96cd5 Mon Sep 17 00:00:00 2001 From: Stavros Date: Tue, 30 Apr 2024 10:49:13 +0300 Subject: [PATCH 1/5] move 1st may fix --- src/Countries/Greece.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index f6242839c..8ddf6e4db 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -32,6 +32,8 @@ protected function variableHolidays(int $year): array // OrthodoxEaster needs to setTimezone $orthodoxEaster = $this->orthodoxEaster($year)->setTimezone("Europe/Athens"); $cleanMonday = $orthodoxEaster->copy()->subDays(48); + $megaliTetarti = $orthodoxEaster->copy()->subDays(4); + $megaliPempti = $orthodoxEaster->copy()->subDays(3); $megaliParaskevi = $orthodoxEaster->copy()->subDays(2); $megaloSavvato = $orthodoxEaster->copy()->subDays(1); $deuteraPasha = $orthodoxEaster->copy()->addDay(); @@ -39,7 +41,7 @@ protected function variableHolidays(int $year): array /** @var CarbonImmutable $protomagia */ $protomagia = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-05-01"); - $moveProtomagia = [$megaliParaskevi, $megaloSavvato, $orthodoxEaster, $deuteraPasha]; + $moveProtomagia = [$megaliTetarti, $megaliPempti, $megaliParaskevi, $megaloSavvato, $orthodoxEaster, $deuteraPasha]; if ( in_array($protomagia, $moveProtomagia) ) { $protomagia = $orthodoxEaster->copy()->addDays(2); From 2fcc94a6a8d9674e183327c67baad00b3630e0f8 Mon Sep 17 00:00:00 2001 From: Stavros Date: Tue, 30 Apr 2024 11:22:41 +0300 Subject: [PATCH 2/5] 1st May fix --- src/Countries/Greece.php | 4 +++- .../GreeceTest/it_can_calculate_hellenic_holidays.snap | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index 8ddf6e4db..28e5493a1 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -31,8 +31,10 @@ protected function variableHolidays(int $year): array { // OrthodoxEaster needs to setTimezone $orthodoxEaster = $this->orthodoxEaster($year)->setTimezone("Europe/Athens"); + $cleanMonday = $orthodoxEaster->copy()->subDays(48); $megaliTetarti = $orthodoxEaster->copy()->subDays(4); + $megaliPempti = $orthodoxEaster->copy()->subDays(3); $megaliParaskevi = $orthodoxEaster->copy()->subDays(2); $megaloSavvato = $orthodoxEaster->copy()->subDays(1); @@ -40,7 +42,7 @@ protected function variableHolidays(int $year): array $agiouPneumatos = $orthodoxEaster->copy()->addDays(50); /** @var CarbonImmutable $protomagia */ - $protomagia = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-05-01"); + $protomagia = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-05-01")->startOfDay(); $moveProtomagia = [$megaliTetarti, $megaliPempti, $megaliParaskevi, $megaloSavvato, $orthodoxEaster, $deuteraPasha]; if ( in_array($protomagia, $moveProtomagia) ) { 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 00c8075cc..6d0af90fb 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 @@ -15,10 +15,6 @@ "name": "25\u03b7 \u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5", "date": "2024-03-25" }, - { - "name": "\u03a0\u03c1\u03c9\u03c4\u03bf\u03bc\u03b1\u03b3\u03b9\u03ac", - "date": "2024-05-01" - }, { "name": "\u039c\u03b5\u03b3\u03ac\u03bb\u03b7 \u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae", "date": "2024-05-03" @@ -31,6 +27,10 @@ "name": "\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1 \u03c4\u03bf\u03c5 \u03a0\u03ac\u03c3\u03c7\u03b1", "date": "2024-05-06" }, + { + "name": "\u03a0\u03c1\u03c9\u03c4\u03bf\u03bc\u03b1\u03b3\u03b9\u03ac", + "date": "2024-05-07" + }, { "name": "\u0391\u03b3\u03af\u03bf\u03c5 \u03a0\u03bd\u03b5\u03cd\u03bc\u03b1\u03c4\u03bf\u03c2", "date": "2024-06-24" From 514e8ce7f152226215b0bdf246bdc7c4760fa05e Mon Sep 17 00:00:00 2001 From: Stavros Date: Tue, 30 Apr 2024 11:47:58 +0300 Subject: [PATCH 3/5] updates --- src/Countries/Greece.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index 2305abd4f..1a39900e2 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -31,16 +31,14 @@ protected function variableHolidays(int $year): array { $orthodoxEaster = $this->orthodoxEaster($year); - $megaliTetarti = $orthodoxEaster->copy()->subDays(4); $megaliPempti = $orthodoxEaster->copy()->subDays(3); $megaliParaskevi = $orthodoxEaster->copy()->subDays(2); $megaloSavvato = $orthodoxEaster->copy()->subDay(); $deuteraPasha = $orthodoxEaster->copy()->addDay(); - $protomagia = CarbonImmutable::createFromDate($year, 5, 1)->startOfDay(); - $moveProtomagia = [$megaliTetarti, $megaliPempti, $megaliParaskevi, $megaloSavvato, $orthodoxEaster, $deuteraPasha]; + $moveProtomagia = [$megaliTetarti, $megaliPempti, $megaliParaskevi, $megaloSavvato, $orthodoxEaster, $deuteraPasha]; if (in_array($protomagia, $moveProtomagia, true)) { $protomagia = $orthodoxEaster->copy()->addDays(2); } From 55d9bf4847354959b0d13ece950d2778490376d1 Mon Sep 17 00:00:00 2001 From: Stavros Date: Tue, 30 Apr 2024 11:55:02 +0300 Subject: [PATCH 4/5] no true in_array --- src/Countries/Greece.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index 1a39900e2..03ff2415d 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -39,7 +39,7 @@ protected function variableHolidays(int $year): array $protomagia = CarbonImmutable::createFromDate($year, 5, 1)->startOfDay(); $moveProtomagia = [$megaliTetarti, $megaliPempti, $megaliParaskevi, $megaloSavvato, $orthodoxEaster, $deuteraPasha]; - if (in_array($protomagia, $moveProtomagia, true)) { + if (in_array($protomagia, $moveProtomagia)) { //no true here $protomagia = $orthodoxEaster->copy()->addDays(2); } From 69856a49b504c1e277a3a13077d72e454cac4037 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Tue, 30 Apr 2024 11:52:33 +0200 Subject: [PATCH 5/5] Update src/Countries/Greece.php --- src/Countries/Greece.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Countries/Greece.php b/src/Countries/Greece.php index 03ff2415d..c14bdd890 100644 --- a/src/Countries/Greece.php +++ b/src/Countries/Greece.php @@ -39,7 +39,7 @@ protected function variableHolidays(int $year): array $protomagia = CarbonImmutable::createFromDate($year, 5, 1)->startOfDay(); $moveProtomagia = [$megaliTetarti, $megaliPempti, $megaliParaskevi, $megaloSavvato, $orthodoxEaster, $deuteraPasha]; - if (in_array($protomagia, $moveProtomagia)) { //no true here + if (in_array($protomagia, $moveProtomagia)) { $protomagia = $orthodoxEaster->copy()->addDays(2); }