Skip to content

Commit

Permalink
Merge branch 'main' into refactor/islamic-calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach authored Mar 22, 2024
2 parents 84538f4 + ee306ae commit be4354c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

All notable changes to `holidays` will be documented in this file.

## 1.8.0 - 2024-03-08

### What's Changed

* Adding holidays for Bahrain by @bo3bdo in https://github.com/spatie/holidays/pull/206
* Add default locale by @Nielsvanpach in https://github.com/spatie/holidays/pull/208
* Fix: Canada Victoria Day correction in test and calculation by @mercury64 in https://github.com/spatie/holidays/pull/211

### New Contributors

* @bo3bdo made their first contribution in https://github.com/spatie/holidays/pull/206
* @mercury64 made their first contribution in https://github.com/spatie/holidays/pull/211

**Full Changelog**: https://github.com/spatie/holidays/compare/1.7.0...1.8.0

## 1.7.0 - 2024-02-08

### What's Changed
Expand Down
9 changes: 3 additions & 6 deletions src/Countries/Canada.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ protected function variableHolidays(int $year): array
{
$easter = $this->easter($year);

/** @var CarbonImmutable $victoriaDay */
$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")

Check failure on line 35 in src/Countries/Canada.php

View workflow job for this annotation

GitHub Actions / phpstan

Cannot call method previous() on Carbon\CarbonImmutable|null.

Check failure on line 35 in src/Countries/Canada.php

View workflow job for this annotation

GitHub Actions / phpstan

Cannot call method previous() on Carbon\CarbonImmutable|null.
->previous('Monday');

return [
'Victoria Day' => $victoriaDay,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"name": "Victoria Day",
"date": "2024-05-27"
"date": "2024-05-20"
},
{
"name": "Canada Day",
Expand Down

0 comments on commit be4354c

Please sign in to comment.