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 @@ -5,6 +5,16 @@ private $events = array(); private $blankState; private $view; + private $moreLink; + + public function setMoreLink($more_link) { + $this->moreLink = $more_link; + return $this; + } + + public function getMoreLink() { + return $this->moreLink; + } private function getView() { return $this->view; @@ -60,7 +70,7 @@ $icon_icon = $event->getIcon(); $icon_color = $event->getIconColor(); - $dot = id(new PHUIIconView()) + $icon = id(new PHUIIconView()) ->setIcon($icon_icon, $icon_color) ->addClass('phui-calendar-list-item-icon'); @@ -108,7 +118,7 @@ ), ), array( - $dot, + $icon, $time, $title, )); @@ -121,6 +131,29 @@ $content); } + if ($this->moreLink) { + $singletons[] = phutil_tag( + 'li', + array( + 'class' => 'phui-calendar-list-item', + ), + phutil_tag( + 'a', + array( + 'href' => $this->moreLink, + 'class' => 'phui-calendar-list-more', + ), + array( + id(new PHUIIconView())->setIcon('fa-ellipsis-h grey'), + phutil_tag( + 'span', + array( + 'class' => 'phui-calendar-list-title', + ), + pht('View More...')), + ))); + } + if (empty($singletons)) { $singletons[] = phutil_tag( 'li', 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 @@ -95,13 +95,13 @@ ->setViewer($viewer) ->setView('month'); foreach ($all_day_events as $item) { - if ($counter <= $max_daily) { + if ($counter < $max_daily) { $list->addEvent($item); } $counter++; } foreach ($list_events as $item) { - if ($counter <= $max_daily) { + if ($counter < $max_daily) { $list->addEvent($item); } $counter++; @@ -112,8 +112,11 @@ $day->format('m').'/'. $day->format('d').'/'; - $day_id = $day->format('Ymd'); + if ($counter > $max_daily) { + $list->setMoreLink($uri); + } + $day_id = $day->format('Ymd'); $classes = array(); if ($day->format('m') != $this->month) {