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

Calendar tooltips should always show start and end time of events.

Summary: Closes T8191, Calendar tooltips should always show start and end time of events.

Test Plan: Open month view, hover over, All day events, multi-day all day events, multi-day non-all-day events, and regular events. Tooltips should be "All day", "All day, <start> - <end>", "<start>-<end>", and "<start>-<end>", respectively.

Reviewers: epriestley, #blessed_reviewers, chad

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T8191

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

+38 -11
+2 -2
resources/celerity/map.php
··· 122 122 'rsrc/css/layout/phabricator-source-code-view.css' => '2ceee894', 123 123 'rsrc/css/phui/calendar/phui-calendar-day.css' => '38891735', 124 124 'rsrc/css/phui/calendar/phui-calendar-list.css' => 'c1d0ca59', 125 - 'rsrc/css/phui/calendar/phui-calendar-month.css' => '75e6a2ee', 125 + 'rsrc/css/phui/calendar/phui-calendar-month.css' => 'e7ee38c6', 126 126 'rsrc/css/phui/calendar/phui-calendar.css' => '8675968e', 127 127 'rsrc/css/phui/phui-action-header-view.css' => '89c497e7', 128 128 'rsrc/css/phui/phui-action-list.css' => '4f4d09f2', ··· 763 763 'phui-calendar-css' => '8675968e', 764 764 'phui-calendar-day-css' => '38891735', 765 765 'phui-calendar-list-css' => 'c1d0ca59', 766 - 'phui-calendar-month-css' => '75e6a2ee', 766 + 'phui-calendar-month-css' => 'e7ee38c6', 767 767 'phui-crumbs-view-css' => '594d719e', 768 768 'phui-document-view-css' => '94d5dcd8', 769 769 'phui-feed-story-css' => 'c9f3a0b5',
+7
src/view/form/control/AphrontFormDateControlValue.php
··· 157 157 ); 158 158 } 159 159 160 + public function getValueAsFormat($format) { 161 + return phabricator_format_local_time( 162 + $this->getEpoch(), 163 + $this->viewer, 164 + $format); 165 + } 166 + 160 167 private function formatTime($epoch, $format) { 161 168 return phabricator_format_local_time( 162 169 $epoch,
+29 -5
src/view/phui/calendar/PHUICalendarListView.php
··· 105 105 106 106 Javelin::initBehavior('phabricator-tooltips'); 107 107 108 - if ($event->getMultiDay()) { 109 - $tip = pht('%s, Until: %s', $event->getName(), 110 - phabricator_date($event->getEpochEnd(), $this->getUser())); 108 + $start = id(AphrontFormDateControlValue::newFromEpoch( 109 + $this->getUser(), 110 + $event->getEpochStart())); 111 + $end = id(AphrontFormDateControlValue::newFromEpoch( 112 + $this->getUser(), 113 + $event->getEpochEnd())); 114 + 115 + if ($event->getIsAllDay()) { 116 + if ($start->getValueDay() == $end->getValueDay()) { 117 + $tip = pht('All day'); 118 + } else { 119 + $tip = pht( 120 + 'All day, %s - %s', 121 + $start->getValueAsFormat('M j, Y'), 122 + $end->getValueAsFormat('M j, Y')); 123 + } 111 124 } else { 112 - $tip = pht('%s, Until: %s', $event->getName(), 113 - phabricator_time($event->getEpochEnd(), $this->getUser())); 125 + if ($start->getValueDay() == $end->getValueDay() && 126 + $start->getValueMonth() == $end->getValueMonth() && 127 + $start->getValueYear() == $end->getValueYear()) { 128 + $tip = pht( 129 + '%s - %s', 130 + $start->getValueAsFormat('g:i A'), 131 + $end->getValueAsFormat('g:i A')); 132 + } else { 133 + $tip = pht( 134 + '%s - %s', 135 + $start->getValueAsFormat('M j, Y, g:i A'), 136 + $end->getValueAsFormat('M j, Y, g:i A')); 137 + } 114 138 } 115 139 116 140 $description = $event->getDescription();
-4
webroot/rsrc/css/phui/calendar/phui-calendar-month.css
··· 88 88 text-align: right; 89 89 } 90 90 91 - .phui-calendar-not-work-day { 92 - background-color: {$lightgreybackground}; 93 - } 94 - 95 91 .phui-calendar-today-slot { 96 92 display: block; 97 93 width: 100%;