diff --git a/src/Countries/Canada.php b/src/Countries/Canada.php index f1350e198..414a8369d 100644 --- a/src/Countries/Canada.php +++ b/src/Countries/Canada.php @@ -31,11 +31,9 @@ protected function variableHolidays(int $year): array { $easter = $this->easter($year); - $victoriaDay = (new CarbonImmutable("last monday of May $year"))->startOfDay(); - - if ($victoriaDay->day < 25) { - $victoriaDay = $victoriaDay->addWeek(); - } + // the Monday preceding May 25 + $victoriaDay = CarbonImmutable::createFromFormat( 'Y-m-d', "{$year}-05-25" ) + ->previous('Monday'); return [ 'Victoria Day' => $victoriaDay, diff --git a/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap b/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap index 3168b8ea2..19caffc6d 100644 --- a/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap +++ b/tests/.pest/snapshots/Countries/CanadaTest/it_can_calculate_canadian_holidays.snap @@ -13,7 +13,7 @@ }, { "name": "Victoria Day", - "date": "2024-05-27" + "date": "2024-05-20" }, { "name": "Canada Day",