Skip to content

Commit

Permalink
Copy non immutable dates to apply timezone
Browse files Browse the repository at this point in the history
Fix #194
  • Loading branch information
kylekatarnls committed Jul 23, 2022
1 parent 4f0a840 commit 8343e61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/OpeningHours.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,10 @@ protected function normalizeDayName(string $day)
protected function applyTimezone(DateTimeInterface $date)
{
if ($this->timezone) {
if ($date instanceof DateTime) {
$date = clone $date;
}

$date = $date->setTimezone($this->timezone);
}

Expand Down

0 comments on commit 8343e61

Please sign in to comment.