@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 calendar part 2

Summary: D8341 was a good start. However, I was looping through all the statuses each time, when I should only deal with a given status once. Instead, unset() a status from the list of statuses once we handled it. Also, delete the last old $key thing, which interfered with my chosen strategy.

Test Plan: made a two day event and verified it showed up in just those two days. (will push and test again just in case but this should be it)

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: Korvin, epriestley, aran

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

+4 -14
+4 -14
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 167 167 $epoch_end = $next_day->format('U'); 168 168 169 169 foreach ($statuses as $status) { 170 + if ($status->getDateTo() < $epoch_start) { 171 + continue; 172 + } 170 173 if ($status->getDateFrom() >= $epoch_end) { 171 - // This list is sorted, so we can stop looking. 172 - break; 174 + continue; 173 175 } 174 176 175 177 $event = new AphrontCalendarEventView(); ··· 180 182 $event->setName($status_text); 181 183 $event->setDescription($status->getDescription()); 182 184 $event->setEventID($status->getID()); 183 - $key = date('Y-m-d', $event->getEpochStart()); 184 185 $events[$epoch_start][] = $event; 185 - // check if this is a multi day event...! 186 - $day_iterator = clone $day; 187 - while (true) { 188 - $day_iterator->modify('+ 1 day'); 189 - $day_iterator_end = $day_iterator->format('U'); 190 - if ($event->getEpochEnd() > $day_iterator_end) { 191 - $events[$day_iterator_end][] = $event; 192 - } else { 193 - break; 194 - } 195 - } 196 186 } 197 187 } 198 188