Skip to content

Commit

Permalink
Merge branch 'master' into Ireland
Browse files Browse the repository at this point in the history
  • Loading branch information
stelgenhof committed Dec 15, 2016
2 parents 3ad1d87 + c07cbfa commit 2eccab3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
23 changes: 6 additions & 17 deletions src/Yasumi/Provider/Greece.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,16 @@ public function calculateCleanMonday()
}

/**
* Calculate the Easter date for Orthodox churches.
* Orthodox Easter
*
* @param int $year
* @param string $timezone
*
* @param int $year the year for which Easter needs to be calculated
* @param string $timezone the timezone in which Easter is celebrated
*
* @return \Datetime date of Orthodox Easter
*
* @link http://php.net/manual/en/function.easter-date.php#83794
* @link https://en.wikipedia.org/wiki/Computus#Adaptation_for_Western_Easter_of_Meeus.27_Julian_algorithm
* @return \Datetime
*/
public function calculateEaster($year, $timezone)
{
$a = $year % 4;
$b = $year % 7;
$c = $year % 19;
$d = (19 * $c + 15) % 30;
$e = (2 * $a + 4 * $b - $d + 34) % 7;
$month = floor(($d + $e + 114) / 31);
$day = (($d + $e + 114) % 31) + 1;

return (new DateTime("$year-$month-$day", new DateTimeZone($timezone)))->add(new DateInterval('P13D'));
return $this->calculateOrthodoxEaster($year, $timezone);
}

/*
Expand Down
12 changes: 8 additions & 4 deletions src/Yasumi/Provider/Poland.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ public function calculateIndependenceDay()
return;
}

$this->addHoliday(new Holiday('independenceDay', ['pl_PL' => 'Narodowe Święto Niepodległości'],
new DateTime("$this->year-11-11", new DateTimeZone($this->timezone)), $this->locale));
$this->addHoliday(new Holiday('independenceDay', [
'en_US' => 'Independence Day',
'pl_PL' => 'Narodowe Święto Niepodległości'
], new DateTime("$this->year-11-11", new DateTimeZone($this->timezone)), $this->locale));
}

/*
Expand All @@ -94,7 +96,9 @@ public function calculateConstitutionDay()
return;
}

$this->addHoliday(new Holiday('constitutionDay', ['pl_PL' => 'Święto Narodowe Trzeciego Maja'],
new DateTime("$this->year-5-3", new DateTimeZone($this->timezone)), $this->locale));
$this->addHoliday(new Holiday('constitutionDay', [
'en_US' => 'Constitution Day',
'pl_PL' => 'Święto Narodowe Trzeciego Maja'
], new DateTime("$this->year-5-3", new DateTimeZone($this->timezone)), $this->locale));
}
}
2 changes: 1 addition & 1 deletion src/Yasumi/Provider/Ukraine.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Ukraine extends AbstractProvider
const ID = 'UA';

/**
* Initialize holidays for Poland.
* Initialize holidays for Ukraine.
*/
public function initialize()
{
Expand Down

0 comments on commit 2eccab3

Please sign in to comment.