1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

Force a couple of Conduit results to the proper types in Calendar

Summary:
Ref T11706. Add some casts so we don't return `"0"` for `false`.

Also I forgot to document one of the things.

Test Plan: Called `calendar.event.search`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11706

Differential Revision: https://secure.phabricator.com/D16690
This commit is contained in:
epriestley 2016-10-11 12:32:32 -07:00
parent fa90f8bef4
commit 13b4b37d30

View file

@ -1056,6 +1056,10 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
->setKey('description')
->setType('string')
->setDescription(pht('The event description.')),
id(new PhabricatorConduitSearchFieldSpecification())
->setKey('isAllDay')
->setType('bool')
->setDescription(pht('True if the event is an all day event.')),
id(new PhabricatorConduitSearchFieldSpecification())
->setKey('startDateTime')
->setType('datetime')
@ -1074,7 +1078,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
return array(
'name' => $this->getName(),
'description' => $this->getDescription(),
'isAllDay' => $this->getIsAllDay(),
'isAllDay' => (bool)$this->getIsAllDay(),
'startDateTime' => $this->getConduitDateTime($start_datetime),
'endDateTime' => $this->getConduitDateTime($end_datetime),
);
@ -1097,7 +1101,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
->overrideTimezoneIdentifier($this->viewerTimezone);
return array(
'epoch' => $epoch,
'epoch' => (int)$epoch,
'display' => array(
'default' => phabricator_datetime($epoch, $viewer),
),