From f677394b6ff35112a9afb3cadadae026521659ab Mon Sep 17 00:00:00 2001 From: lkassianik Date: Wed, 13 May 2015 12:01:04 -0700 Subject: [PATCH] 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 --- .../PhabricatorPeopleCalendarController.php | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/applications/people/controller/PhabricatorPeopleCalendarController.php b/src/applications/people/controller/PhabricatorPeopleCalendarController.php index 06c7033fd7..b2d1f74ab7 100644 --- a/src/applications/people/controller/PhabricatorPeopleCalendarController.php +++ b/src/applications/people/controller/PhabricatorPeopleCalendarController.php @@ -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);