Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15391646
D13318.id32289.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13318.id32289.diff
View Options
diff --git a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
--- a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
+++ b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
@@ -313,17 +313,31 @@
$list = new PHUIObjectItemListView();
foreach ($events as $event) {
$from = phabricator_datetime($event->getDateFrom(), $viewer);
- $to = phabricator_datetime($event->getDateTo(), $viewer);
+ $duration = '';
$creator_handle = $handles[$event->getUserPHID()];
+ $attendees = array();
+ foreach ($event->getInvitees() as $invitee) {
+ $attendees[] = $invitee->getInviteePHID();
+ }
+
+ $attendees = pht(
+ 'Attending: %s',
+ $viewer->renderHandleList($attendees)
+ ->setAsInline(1)
+ ->render());
+
+ if (strlen($event->getDuration()) > 0) {
+ $duration = pht(
+ 'Duration: %s',
+ $event->getDuration());
+ }
+
$item = id(new PHUIObjectItemView())
- ->setHeader($event->getName())
- ->setHref($event->getURI())
- ->addByline(pht('Creator: %s', $creator_handle->renderLink()))
- ->addAttribute(pht('From %s to %s', $from, $to))
- ->addAttribute(id(new PhutilUTF8StringTruncator())
- ->setMaximumGlyphs(64)
- ->truncateString($event->getDescription()));
+ ->setHeader($viewer->renderHandle($event->getPHID())->render())
+ ->addAttribute($attendees)
+ ->addIcon('none', $from)
+ ->addIcon('none', $duration);
$list->addItem($item);
}
diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
--- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php
+++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
@@ -373,6 +373,29 @@
return false;
}
+ public function getDuration() {
+ $seconds = $this->dateTo - $this->dateFrom;
+ $minutes = round($seconds / 60, 1);
+ $hours = round($minutes / 60, 3);
+ $days = round($hours / 24, 2);
+
+ $duration = '';
+
+ if ($days >= 1) {
+ return pht(
+ '%s day(s)',
+ round($days, 1));
+ } else if ($hours >= 1) {
+ return pht(
+ '%s hour(s)',
+ round($hours, 1));
+ } else if ($minutes >= 1) {
+ return pht(
+ '%s minute(s)',
+ round($minutes, 0));
+ }
+ }
+
/* -( Markup Interface )--------------------------------------------------- */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 10:50 AM (6 d, 22 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705991
Default Alt Text
D13318.id32289.diff (2 KB)
Attached To
Mode
D13318: Format Calendar list objects
Attached
Detach File
Event Timeline
Log In to Comment