Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13997825
D16688.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D16688.diff
View Options
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
@@ -1056,13 +1056,27 @@
->setKey('description')
->setType('string')
->setDescription(pht('The event description.')),
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('startDateTime')
+ ->setType('datetime')
+ ->setDescription(pht('Start date and time of the event.')),
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('endDateTime')
+ ->setType('datetime')
+ ->setDescription(pht('End date and time of the event.')),
);
}
public function getFieldValuesForConduit() {
+ $start_datetime = $this->newStartDateTime();
+ $end_datetime = $this->newEndDateTime();
+
return array(
'name' => $this->getName(),
'description' => $this->getDescription(),
+ 'isAllDay' => $this->getIsAllDay(),
+ 'startDateTime' => $this->getConduitDateTime($start_datetime),
+ 'endDateTime' => $this->getConduitDateTime($end_datetime),
);
}
@@ -1070,4 +1084,26 @@
return array();
}
+ private function getConduitDateTime($datetime) {
+ if (!$datetime) {
+ return null;
+ }
+
+ $epoch = $datetime->getEpoch();
+
+ // TODO: Possibly pass the actual viewer in from the Conduit stuff, or
+ // retain it when setting the viewer timezone?
+ $viewer = id(new PhabricatorUser())
+ ->overrideTimezoneIdentifier($this->viewerTimezone);
+
+ return array(
+ 'epoch' => $epoch,
+ 'display' => array(
+ 'default' => phabricator_datetime($epoch, $viewer),
+ ),
+ 'iso8601' => $datetime->getISO8601(),
+ 'timezone' => $this->viewerTimezone,
+ );
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 25, 6:22 AM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6746508
Default Alt Text
D16688.diff (1 KB)
Attached To
Mode
D16688: Provide start/end date time via Conduit for Calendar
Attached
Detach File
Event Timeline
Log In to Comment