mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Calendar query results should be ordered from first start date to last start date
Summary: Closes T8041, Calendar query results should be ordered from first start date to last start date Test Plan: Open "Upcoming Events" in Calendar, verify that the event with the first start date is first and that events are ordered in ascending start dates. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8041 Differential Revision: https://secure.phabricator.com/D12968
This commit is contained in:
parent
df15220884
commit
680e8fdfdb
1 changed files with 24 additions and 0 deletions
|
@ -42,6 +42,30 @@ final class PhabricatorCalendarEventQuery
|
|||
return $this;
|
||||
}
|
||||
|
||||
protected function getDefaultOrderVector() {
|
||||
return array('start', 'id');
|
||||
}
|
||||
|
||||
public function getOrderableColumns() {
|
||||
return array(
|
||||
'start' => array(
|
||||
'table' => $this->getPrimaryTableAlias(),
|
||||
'column' => 'dateFrom',
|
||||
'reverse' => true,
|
||||
'type' => 'int',
|
||||
'unique' => false,
|
||||
),
|
||||
) + parent::getOrderableColumns();
|
||||
}
|
||||
|
||||
protected function getPagingValueMap($cursor, array $keys) {
|
||||
$event = $this->loadCursorObject($cursor);
|
||||
return array(
|
||||
'start' => $event->getDateFrom(),
|
||||
'id' => $event->getID(),
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadPage() {
|
||||
$table = new PhabricatorCalendarEvent();
|
||||
$conn_r = $table->establishConnection('r');
|
||||
|
|
Loading…
Reference in a new issue