@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix day view start hour

Summary: Ref T8308, Fix day view start hour

Test Plan: Day views start at 8am OR hour of first event start time if there is an event scheduled before 8am on that day OR midnight if there is a non-all-day multi-day event carried over from the previous day

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T8308

Differential Revision: https://secure.phabricator.com/D13013

+9 -12
+9 -12
src/view/phui/calendar/PHUICalendarDayView.php
··· 91 91 92 92 $this->events = msort($this->events, 'getEpochStart'); 93 93 $first_event_hour = $this->getDateTime()->setTime(8, 0, 0); 94 + $midnight = $this->getDateTime()->setTime(0, 0, 0); 94 95 95 96 foreach ($this->events as $event) { 96 97 if ($event->getIsAllDay()) { ··· 99 100 if ($event->getEpochStart() <= $day_end_epoch && 100 101 $event->getEpochEnd() > $day_start_epoch) { 101 102 102 - if ($first_event_hour === null) { 103 + if ($event->getEpochStart() < $midnight->format('U') && 104 + $event->getEpochEnd() > $midnight->format('U')) { 105 + $first_event_hour = clone $midnight; 106 + } 107 + 108 + if ($event->getEpochStart() < $first_event_hour->format('U') && 109 + $event->getEpochStart() > $midnight->format('U')) { 103 110 $first_event_hour = PhabricatorTime::getDateTimeFromEpoch( 104 111 $event->getEpochStart(), 105 112 $viewer); 106 - 107 - $midnight = $this->getDateTime()->setTime(0, 0, 0); 108 - 109 - if ($first_event_hour->format('U') < $midnight->format('U')) { 110 - $first_event_hour = clone $midnight; 111 - } 112 - 113 - $eight_am = $this->getDateTime()->setTime(8, 0, 0); 114 - if ($eight_am->format('U') < $first_event_hour->format('U')) { 115 - $first_event_hour = clone $eight_am; 116 - } 113 + $first_event_hour->setTime($first_event_hour->format('h'), 0, 0); 117 114 } 118 115 119 116 $event_start = max($event->getEpochStart(), $day_start_epoch);