Skip to content

Commit

Permalink
Add greece holidays (#226)
Browse files Browse the repository at this point in the history
* move 1st may fix

* 1st May fix

* updates

* no true in_array

* Update src/Countries/Greece.php

---------

Co-authored-by: Niels Vanpachtenbeke <[email protected]>
  • Loading branch information
lowv-developer and Nielsvanpach committed Apr 30, 2024
1 parent b4e291b commit b7ef716
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/Countries/Greece.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ protected function allHolidays(int $year): array
/** @return array<string, CarbonImmutable> */
protected function variableHolidays(int $year): array
{
$orthodoxEaster = $this->orthodoxEaster($year);

$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();

$protomagia = CarbonImmutable::createFromDate($year, 5, 1);
$moveProtomagia = [$megaliParaskevi, $megaloSavvato, $orthodoxEaster, $deuteraPasha];

if (in_array($protomagia, $moveProtomagia, true)) {
$moveProtomagia = [$megaliTetarti, $megaliPempti, $megaliParaskevi, $megaloSavvato, $orthodoxEaster, $deuteraPasha];
if (in_array($protomagia, $moveProtomagia)) {
$protomagia = $orthodoxEaster->copy()->addDays(2);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit b7ef716

Please sign in to comment.