1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00

All day events should obey selected query range in viewer timezone.

Summary: Fixes T8147, All day events should obey selected query range in viewer timezone.

Test Plan: Create all day event May 25, query for events May 26-27. All day event should not be part of the query results list.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8147

Differential Revision: https://secure.phabricator.com/D13023
This commit is contained in:
lkassianik 2015-05-26 14:28:07 -07:00
parent 08a9e0f22a
commit 46c5e055a2

View file

@ -180,6 +180,21 @@ final class PhabricatorCalendarEventQuery
protected function willFilterPage(array $events) { protected function willFilterPage(array $events) {
$range_start = $this->rangeBegin;
$range_end = $this->rangeEnd;
foreach ($events as $key => $event) {
$event_start = $event->getDateFrom();
$event_end = $event->getDateTo();
if ($range_start && $event_end < $range_start) {
unset($events[$key]);
}
if ($range_end && $event_start > $range_end) {
unset($events[$key]);
}
}
$phids = array(); $phids = array();
foreach ($events as $event) { foreach ($events as $event) {
@ -197,6 +212,8 @@ final class PhabricatorCalendarEventQuery
$event->attachInvitees($event_invitees); $event->attachInvitees($event_invitees);
} }
$events = msort($events, 'getDateFrom');
return $events; return $events;
} }