Skip to content

Commit

Permalink
update fix holiday to string and easter function
Browse files Browse the repository at this point in the history
  • Loading branch information
hafiz committed Jan 25, 2024
1 parent c7cc56b commit fb4c208
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Countries/Malaysia.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ protected function allHolidays(int $year): array

/**
* @param int $year
* @return array<string, CarbonImmutable>
* @return array<string, string>
*/
protected function fixHolidays(int $year): array
{
return [
'Hari Pekerja' => CarbonImmutable::createFromDate($year, 5, 1, $this->timezone),
'Hari Kebangsaan' => CarbonImmutable::createFromDate($year, 8, 31, $this->timezone),
'Hari Malaysia' => CarbonImmutable::createFromDate($year, 9, 16, $this->timezone),
'Hari Krismas' => CarbonImmutable::createFromDate($year, 12, 25, $this->timezone),
'Hari Pekerja' => '05-01',
'Hari Kebangsaan' => '08-31',
'Hari Malaysia' => '09-16',
'Hari Krismas' => '12-25',
];
}

Expand Down Expand Up @@ -507,8 +507,7 @@ protected function pestaKaamatan(int $year): CarbonImmutable

protected function goodFriday(int $year): CarbonImmutable
{
$easter = CarbonImmutable::createFromTimestamp(easter_date($year))
->setTimezone($this->timezone);
$easter = $this->easter($year);

return $easter->subDays(2);
}
Expand Down

0 comments on commit fb4c208

Please sign in to comment.