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:
parent
08a9e0f22a
commit
46c5e055a2
1 changed files with 17 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue