Skip to content

Commit 7f5ff89

Browse files
committed
Use RRule->setTimezone()
Requires Icinga/ipl-scheduler#55
1 parent fe1ff89 commit 7f5ff89

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/Notifications/Widget/Timeline/Rotation.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Generator;
1010
use Icinga\Module\Notifications\Common\Links;
1111
use Icinga\Module\Notifications\Forms\RotationConfigForm;
12+
use Icinga\Module\Notifications\Util\ScheduleTimezoneStorage;
1213
use ipl\I18n\Translation;
1314
use ipl\Scheduler\RRule;
1415
use ipl\Stdlib\Filter;
@@ -156,8 +157,9 @@ public function fetchTimeperiodEntries(DateTime $after, DateTime $until): Genera
156157
$firstHandoff = $timeperiodEntry->start_time;
157158
}
158159

159-
$rrule = new RRule($timeperiodEntry->rrule, $displayTimezone->getName());
160-
$rrule->startAt($firstHandoff);
160+
$rrule = (new RRule($timeperiodEntry->rrule))
161+
->setTimezone(ScheduleTimezoneStorage::getScheduleTimezone())
162+
->startAt($firstHandoff);
161163

162164
$length = $timeperiodEntry->start_time->diff($timeperiodEntry->end_time);
163165
$limit = (((int) ceil($after->diff($until)->days / $interval)) + 1) * $limitMultiplier;

0 commit comments

Comments
 (0)