@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.

Add allday, multiday logic to AphrontEventView

Summary: Hardens up the logic for DST and makes them easier to access elsewhere.

Test Plan: view sample events, all day and multiday, in my sandbox

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

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

+18 -9
+16
src/applications/calendar/view/AphrontCalendarEventView.php
··· 71 71 } 72 72 } 73 73 74 + public function getAllDay() { 75 + $time = (60 * 60 * 22); 76 + if (($this->getEpochEnd() - $this->getEpochStart()) >= $time) { 77 + return true; 78 + } 79 + return false; 80 + } 81 + 82 + public function getMultiDay() { 83 + $nextday = strtotime('12:00 AM Tomorrow', $this->getEpochStart()); 84 + if ($this->getEpochEnd() > $nextday) { 85 + return true; 86 + } 87 + return false; 88 + } 89 + 74 90 public function render() { 75 91 throw new Exception("Events are only rendered indirectly."); 76 92 }
+2 -9
src/view/phui/calendar/PHUICalendarListView.php
··· 32 32 33 33 $events = msort($this->events, 'getEpochStart'); 34 34 35 - // All Day Event (well, 23 hours, 59 minutes worth) 36 - $timespan = ((3600 * 24) - 60); 37 - 38 35 $singletons = array(); 39 36 $allday = false; 40 37 foreach ($events as $event) { 41 38 $color = $event->getColor(); 42 39 43 - $length = ($event->getEpochEnd() - $event->getEpochStart()); 44 - if ($length >= $timespan) { 40 + if ($event->getAllDay()) { 45 41 $timelabel = pht('All Day'); 46 42 } else { 47 43 $timelabel = phabricator_time( ··· 99 95 100 96 Javelin::initBehavior('phabricator-tooltips'); 101 97 102 - // Multiple Days 103 - $timespan = ((3600 * 24) + 60); 104 - $length = ($event->getEpochEnd() - $event->getEpochStart()); 105 - if ($length >= $timespan) { 98 + if ($event->getMultiDay()) { 106 99 $tip = pht('%s, Until: %s', $event->getName(), 107 100 phabricator_date($event->getEpochEnd(), $this->getUser())); 108 101 } else {