mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
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
This commit is contained in:
parent
3d40a5871d
commit
447c372cfe
3 changed files with 13 additions and 5 deletions
|
@ -101,13 +101,14 @@ final class PhabricatorCalendarEventQuery
|
|||
foreach ($events as $event) {
|
||||
$sequence_start = 0;
|
||||
$instance_count = null;
|
||||
$duration = $event->getDateTo() - $event->getDateFrom();
|
||||
|
||||
if ($event->getIsRecurring()) {
|
||||
$frequency = $event->getFrequencyUnit();
|
||||
$modify_key = '+1 '.$frequency;
|
||||
|
||||
if ($this->rangeBegin && $this->rangeBegin > $event->getDateFrom()) {
|
||||
$max_date = $this->rangeBegin;
|
||||
$max_date = $this->rangeBegin - $duration;
|
||||
$date = $event->getDateFrom();
|
||||
$datetime = PhabricatorTime::getDateTimeFromEpoch($date, $viewer);
|
||||
|
||||
|
@ -120,7 +121,7 @@ final class PhabricatorCalendarEventQuery
|
|||
|
||||
$start = $this->rangeBegin;
|
||||
} else {
|
||||
$start = $event->getDateFrom();
|
||||
$start = $event->getDateFrom() - $duration;
|
||||
}
|
||||
|
||||
$date = $start;
|
||||
|
|
|
@ -307,7 +307,6 @@ final class PhabricatorCalendarEventSearchEngine
|
|||
$viewer = $this->requireViewer();
|
||||
$list = new PHUIObjectItemListView();
|
||||
foreach ($events as $event) {
|
||||
// $href = '/E'.$event->getID();
|
||||
$from = phabricator_datetime($event->getDateFrom(), $viewer);
|
||||
$to = phabricator_datetime($event->getDateTo(), $viewer);
|
||||
$creator_handle = $handles[$event->getUserPHID()];
|
||||
|
|
|
@ -89,13 +89,21 @@ final class PHUICalendarMonthView extends AphrontView {
|
|||
}
|
||||
}
|
||||
|
||||
$max_daily = 15;
|
||||
$counter = 0;
|
||||
|
||||
$list = new PHUICalendarListView();
|
||||
$list->setUser($this->user);
|
||||
foreach ($all_day_events as $item) {
|
||||
$list->addEvent($item);
|
||||
if ($counter <= $max_daily) {
|
||||
$list->addEvent($item);
|
||||
}
|
||||
$counter++;
|
||||
}
|
||||
foreach ($list_events as $item) {
|
||||
$list->addEvent($item);
|
||||
if ($counter <= $max_daily) {
|
||||
$list->addEvent($item);
|
||||
}
|
||||
}
|
||||
|
||||
$uri = $this->getBrowseURI();
|
||||
|
|
Loading…
Reference in a new issue