Page MenuHomePhabricator

D15964.diff
No OneTemporary

D15964.diff

diff --git a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php
--- a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php
+++ b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php
@@ -223,6 +223,7 @@
$events = msort($events, 'getEpochStart');
$day_view = id(new PHUICalendarWeekView())
->setViewer($viewer)
+ ->setView('week')
->setEvents($events)
->setWeekLength(3)
->render();
diff --git a/src/view/phui/calendar/PHUICalendarListView.php b/src/view/phui/calendar/PHUICalendarListView.php
--- a/src/view/phui/calendar/PHUICalendarListView.php
+++ b/src/view/phui/calendar/PHUICalendarListView.php
@@ -85,7 +85,13 @@
}
$tip = $this->getEventTooltip($event);
- $tip_align = ($this->getView() == 'day') ? 'E' : 'N';
+ if ($this->getView() == 'day') {
+ $tip_align = 'E';
+ } else if ($this->getView() == 'month') {
+ $tip_align = 'N';
+ } else {
+ $tip_align = 'W';
+ }
$content = javelin_tag(
'a',
array(
diff --git a/src/view/phui/calendar/PHUICalendarMonthView.php b/src/view/phui/calendar/PHUICalendarMonthView.php
--- a/src/view/phui/calendar/PHUICalendarMonthView.php
+++ b/src/view/phui/calendar/PHUICalendarMonthView.php
@@ -90,8 +90,9 @@
$max_daily = 15;
$counter = 0;
- $list = new PHUICalendarListView();
- $list->setViewer($viewer);
+ $list = id(new PHUICalendarListView())
+ ->setViewer($viewer)
+ ->setView('month');
foreach ($all_day_events as $item) {
if ($counter <= $max_daily) {
$list->addEvent($item);
diff --git a/src/view/phui/calendar/PHUICalendarWeekView.php b/src/view/phui/calendar/PHUICalendarWeekView.php
--- a/src/view/phui/calendar/PHUICalendarWeekView.php
+++ b/src/view/phui/calendar/PHUICalendarWeekView.php
@@ -4,6 +4,7 @@
private $events;
private $dateTime;
private $weekLength = 7;
+ private $view = 'day';
public function setEvents($events) {
$this->events = $events;
@@ -27,6 +28,15 @@
return $this;
}
+ public function setView($view) {
+ $this->view = $view;
+ return $this;
+ }
+
+ private function getView() {
+ return $this->view;
+ }
+
public function render() {
$this->events = msort($this->events, 'getEpochStart');
$week_of_boxes = $this->getWeekOfBoxes();
@@ -64,7 +74,7 @@
$list = id(new PHUICalendarListView())
->setUser($this->getViewer())
- ->setView('day');
+ ->setView($this->getView());
if (count($events) == 0) {
$list->showBlankState(true);

File Metadata

Mime Type
text/plain
Expires
Wed, May 22, 3:14 AM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6286875
Default Alt Text
D15964.diff (2 KB)

Event Timeline