Skip to content

Commit 447c372

Browse files
author
lkassianik
committed
Generated ghost events should start generating as early as the range start minus the duration of the event.
Summary: Fixes T8347, Generated ghost events should start generating as early as the range start minus the duration of the event. Test Plan: Create a year long weekly event, a year later, each day should have about 52 events. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8347 Differential Revision: https://secure.phabricator.com/D13069
1 parent 3d40a58 commit 447c372

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/applications/calendar/query/PhabricatorCalendarEventQuery.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,14 @@ protected function loadPage() {
101101
foreach ($events as $event) {
102102
$sequence_start = 0;
103103
$instance_count = null;
104+
$duration = $event->getDateTo() - $event->getDateFrom();
104105

105106
if ($event->getIsRecurring()) {
106107
$frequency = $event->getFrequencyUnit();
107108
$modify_key = '+1 '.$frequency;
108109

109110
if ($this->rangeBegin && $this->rangeBegin > $event->getDateFrom()) {
110-
$max_date = $this->rangeBegin;
111+
$max_date = $this->rangeBegin - $duration;
111112
$date = $event->getDateFrom();
112113
$datetime = PhabricatorTime::getDateTimeFromEpoch($date, $viewer);
113114

@@ -120,7 +121,7 @@ protected function loadPage() {
120121

121122
$start = $this->rangeBegin;
122123
} else {
123-
$start = $event->getDateFrom();
124+
$start = $event->getDateFrom() - $duration;
124125
}
125126

126127
$date = $start;

src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ protected function renderResultList(
307307
$viewer = $this->requireViewer();
308308
$list = new PHUIObjectItemListView();
309309
foreach ($events as $event) {
310-
// $href = '/E'.$event->getID();
311310
$from = phabricator_datetime($event->getDateFrom(), $viewer);
312311
$to = phabricator_datetime($event->getDateTo(), $viewer);
313312
$creator_handle = $handles[$event->getUserPHID()];

src/view/phui/calendar/PHUICalendarMonthView.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,21 @@ public function render() {
8989
}
9090
}
9191

92+
$max_daily = 15;
93+
$counter = 0;
94+
9295
$list = new PHUICalendarListView();
9396
$list->setUser($this->user);
9497
foreach ($all_day_events as $item) {
95-
$list->addEvent($item);
98+
if ($counter <= $max_daily) {
99+
$list->addEvent($item);
100+
}
101+
$counter++;
96102
}
97103
foreach ($list_events as $item) {
98-
$list->addEvent($item);
104+
if ($counter <= $max_daily) {
105+
$list->addEvent($item);
106+
}
99107
}
100108

101109
$uri = $this->getBrowseURI();

0 commit comments

Comments
 (0)