Skip to content

Commit

Permalink
remove timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach committed Feb 1, 2024
1 parent 914ae68 commit 9896b2f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Countries/Australia.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function allHolidays(int $year): array
/** @return array<string, CarbonImmutable> */
protected function variableHolidays(int $year): array
{
$easter = $this->easter($year)->setTimezone('Australia/Sydney');
$easter = $this->easter($year);

return [
'Good Friday' => $easter->subDays(2),
Expand Down
2 changes: 1 addition & 1 deletion src/Countries/Greece.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
$cleanMonday = $orthodoxEaster->copy()->subDays(48);
$megaliParaskevi = $orthodoxEaster->copy()->subDays(2);
$megaloSavvato = $orthodoxEaster->copy()->subDays(1);
Expand Down
12 changes: 4 additions & 8 deletions src/Countries/Japan.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,13 @@ protected function allHolidays(int $year): array
/** @return array<string, CarbonImmutable> */
protected function variableHolidays(int $year): array
{
$comingOfAgeDay = (new CarbonImmutable("second monday of january $year")) // Coming of Age Day
->setTimezone('Asia/Tokyo');
$comingOfAgeDay = (new CarbonImmutable("second monday of january $year"))->startOfDay();

$oceansDay = (new CarbonImmutable("third monday of july $year")) // Ocean's Day
->setTimezone('Asia/Tokyo');
$oceansDay = (new CarbonImmutable("third monday of july $year"))->startOfDay();

$respectForTheAgedDay = (new CarbonImmutable("third monday of september $year")) // Respect for the Aged Day
->setTimezone('Asia/Tokyo');
$respectForTheAgedDay = (new CarbonImmutable("third monday of september $year"))->startOfDay();

$sportsDay = (new CarbonImmutable("second monday of october $year")) // Sports Day
->setTimezone('Asia/Tokyo');
$sportsDay = (new CarbonImmutable("second monday of october $year"))->startOfDay();

$holidays = [
'成人の日' => $comingOfAgeDay,
Expand Down
3 changes: 1 addition & 2 deletions src/Countries/Kenya.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ protected function allHolidays(int $year): array
/** @return array<string, CarbonImmutable> */
protected function variableHolidays(int $year): array
{
$easter = CarbonImmutable::createFromTimestamp(easter_date($year))
->setTimezone('Africa/Nairobi');
$easter = $this->easter($year);

return [
'Good Friday' => $easter->subDays(2),
Expand Down
2 changes: 1 addition & 1 deletion src/Countries/Montenegro.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function allHolidays(int $year): array
public function variableHolidays(int $year): array
{
// Orthodox Easter calculation needs to be in the same timezone as the country
$orthodoxEaster = $this->orthodoxEaster($year)->setTimezone('Europe/Podgorica');
$orthodoxEaster = $this->orthodoxEaster($year);
$goodFriday = $orthodoxEaster->copy()->subDays(2);
$orthodoxEasterMonday = $orthodoxEaster->copy()->addDay();

Expand Down
3 changes: 1 addition & 2 deletions src/Countries/Vietnam.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ protected function getTheExtraDayForIndependenceDay(int $year): array
return [];
}

$independenceDay = CarbonImmutable::parse("$year-09-02")
->setTimeZone('Asia/Ho_Chi_Minh');
$independenceDay = CarbonImmutable::parse("$year-09-02")->startOfDay();

if ($independenceDay->dayOfWeek === CarbonInterface::MONDAY) {
return ['Ngày Sau Quốc Khánh' => $independenceDay->addDay()];
Expand Down

0 comments on commit 9896b2f

Please sign in to comment.