Skip to content

Commit ef55c7c

Browse files
committed
Round times between 11:45 and 11:59 pm to 11:30 pm
Because the clock does only support times from 12:00 am to 11:30 pm in 30 minute steps.
1 parent 107caf4 commit ef55c7c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/Notifications/Widget/Timeline.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,13 @@ protected function assemble()
370370
)
371371
);
372372

373+
$beforeHour = $now->format('H');
373374
$now = Util::roundToNearestThirtyMinute($now);
374375

376+
if ($beforeHour === '23' && $now->format('H') === '00') {
377+
$now->sub(new DateInterval('PT30M'));
378+
}
379+
375380
$this->getStyle()->addFor($currentTime, [
376381
'--timeStartColumn' =>
377382
$now->format('G') * 2 // 2 columns per hour

0 commit comments

Comments
 (0)