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

Provide start/end date time via Conduit for Calendar

Summary: Fixes T11706. I think this approach (roughly: provide the information in a few different formats) is generally reasonable, and should let clients choose how much date/time magic they want to do.

Test Plan: Called `calenadar.event.search`, viewed results.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11706

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

+36
+36
src/applications/calendar/storage/PhabricatorCalendarEvent.php
··· 1056 1056 ->setKey('description') 1057 1057 ->setType('string') 1058 1058 ->setDescription(pht('The event description.')), 1059 + id(new PhabricatorConduitSearchFieldSpecification()) 1060 + ->setKey('startDateTime') 1061 + ->setType('datetime') 1062 + ->setDescription(pht('Start date and time of the event.')), 1063 + id(new PhabricatorConduitSearchFieldSpecification()) 1064 + ->setKey('endDateTime') 1065 + ->setType('datetime') 1066 + ->setDescription(pht('End date and time of the event.')), 1059 1067 ); 1060 1068 } 1061 1069 1062 1070 public function getFieldValuesForConduit() { 1071 + $start_datetime = $this->newStartDateTime(); 1072 + $end_datetime = $this->newEndDateTime(); 1073 + 1063 1074 return array( 1064 1075 'name' => $this->getName(), 1065 1076 'description' => $this->getDescription(), 1077 + 'isAllDay' => $this->getIsAllDay(), 1078 + 'startDateTime' => $this->getConduitDateTime($start_datetime), 1079 + 'endDateTime' => $this->getConduitDateTime($end_datetime), 1066 1080 ); 1067 1081 } 1068 1082 1069 1083 public function getConduitSearchAttachments() { 1070 1084 return array(); 1085 + } 1086 + 1087 + private function getConduitDateTime($datetime) { 1088 + if (!$datetime) { 1089 + return null; 1090 + } 1091 + 1092 + $epoch = $datetime->getEpoch(); 1093 + 1094 + // TODO: Possibly pass the actual viewer in from the Conduit stuff, or 1095 + // retain it when setting the viewer timezone? 1096 + $viewer = id(new PhabricatorUser()) 1097 + ->overrideTimezoneIdentifier($this->viewerTimezone); 1098 + 1099 + return array( 1100 + 'epoch' => $epoch, 1101 + 'display' => array( 1102 + 'default' => phabricator_datetime($epoch, $viewer), 1103 + ), 1104 + 'iso8601' => $datetime->getISO8601(), 1105 + 'timezone' => $this->viewerTimezone, 1106 + ); 1071 1107 } 1072 1108 1073 1109 }