1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-29 16:08:22 +01:00

People calendar month view should pass AphrontFormDateControlValue for start range and end range to MonthView

Summary: Fixes T8181, People calendar month view should pass AphrontFormDateControlValue for start range and end range to MonthView

Test Plan: Open install/p/epriestley/calendar without error

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T8181

Differential Revision: https://secure.phabricator.com/D12827
This commit is contained in:
lkassianik 2015-05-13 12:01:04 -07:00
parent b36a8fa885
commit f677394b6f

View file

@ -41,18 +41,37 @@ final class PhabricatorPeopleCalendarController
"{$year}-{$month}-01",
"{$year}-{$month}-31");
$start_epoch = strtotime("{$year}-{$month}-01");
$end_epoch = strtotime("{$year}-{$month}-01 next month");
$statuses = id(new PhabricatorCalendarEventQuery())
->setViewer($user)
->withInvitedPHIDs(array($user->getPHID()))
->withDateRange(
strtotime("{$year}-{$month}-01"),
strtotime("{$year}-{$month}-01 next month"))
$start_epoch,
$end_epoch)
->execute();
$start_range_value = AphrontFormDateControlValue::newFromEpoch(
$user,
$start_epoch);
$end_range_value = AphrontFormDateControlValue::newFromEpoch(
$user,
$end_epoch);
if ($month == $month_d && $year == $year_d) {
$month_view = new PHUICalendarMonthView($month, $year, $day);
$month_view = new PHUICalendarMonthView(
$start_range_value,
$end_range_value,
$month,
$year,
$day);
} else {
$month_view = new PHUICalendarMonthView($month, $year);
$month_view = new PHUICalendarMonthView(
$start_range_value,
$end_range_value,
$month,
$year);
}
$month_view->setBrowseURI($request->getRequestURI());
@ -67,7 +86,7 @@ final class PhabricatorPeopleCalendarController
$event = new AphrontCalendarEventView();
$event->setEpochRange($status->getDateFrom(), $status->getDateTo());
$event->setUserPHID($status->getUserPHID());
$event->setName($status->getHumanStatus());
$event->setName($status->getName());
$event->setDescription($status->getDescription());
$event->setEventID($status->getID());
$month_view->addEvent($event);