@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

This week should be marked with a bottom blue horizontal bar in Calendar month view.

Summary: Closes T8185, This week should be marked with a bottom blue horizontal bar in Calendar month view.

Test Plan: Open calendar month view, "this week" should show a dark blue bar under it and a lighter blue bar on "today".

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8185

Differential Revision: https://secure.phabricator.com/D12862

+62 -6
+2 -2
resources/celerity/map.php
··· 122 122 'rsrc/css/layout/phabricator-source-code-view.css' => '2ceee894', 123 123 'rsrc/css/phui/calendar/phui-calendar-day.css' => '3b4a65d8', 124 124 'rsrc/css/phui/calendar/phui-calendar-list.css' => '840baa8d', 125 - 'rsrc/css/phui/calendar/phui-calendar-month.css' => '7819a8b1', 125 + 'rsrc/css/phui/calendar/phui-calendar-month.css' => '4fba442e', 126 126 'rsrc/css/phui/calendar/phui-calendar.css' => '8345be98', 127 127 'rsrc/css/phui/phui-action-header-view.css' => '89c497e7', 128 128 'rsrc/css/phui/phui-action-list.css' => '4f4d09f2', ··· 763 763 'phui-calendar-css' => '8345be98', 764 764 'phui-calendar-day-css' => '3b4a65d8', 765 765 'phui-calendar-list-css' => '840baa8d', 766 - 'phui-calendar-month-css' => '7819a8b1', 766 + 'phui-calendar-month-css' => '4fba442e', 767 767 'phui-crumbs-view-css' => '594d719e', 768 768 'phui-document-view-css' => '94d5dcd8', 769 769 'phui-feed-story-css' => 'c9f3a0b5',
+47
src/view/phui/calendar/PHUICalendarMonthView.php
··· 228 228 $today_class = 'phui-calendar-today-slot'; 229 229 } 230 230 231 + if ($this->isDateInCurrentWeek($date)) { 232 + $today_class .= ' phui-calendar-this-week'; 233 + } 234 + 235 + $last_week_day = 6; 236 + if ($date->format('w') == $last_week_day) { 237 + $today_class .= ' last-weekday'; 238 + } 239 + 231 240 $today_slot = phutil_tag ( 232 241 'div', 233 242 array( ··· 252 261 'class' => 'phui-calendar-date-number-container '.$class, 253 262 ), 254 263 $cell_div); 264 + } 265 + 266 + private function isDateInCurrentWeek($date) { 267 + list($week_start_date, $week_end_date) = $this->getThisWeekRange(); 268 + 269 + if ($date->format('U') < $week_end_date->format('U') && 270 + $date->format('U') >= $week_start_date->format('U')) { 271 + return true; 272 + } 273 + return false; 255 274 } 256 275 257 276 private function getEventCountBadge($count, $viewer_is_invited) { ··· 482 501 } 483 502 484 503 return $days; 504 + } 505 + 506 + private function getTodayMidnight() { 507 + $viewer = $this->getUser(); 508 + $today = new DateTime('@'.time()); 509 + $today->setTimeZone($viewer->getTimeZone()); 510 + $today->setTime(0, 0, 0); 511 + 512 + return $today; 513 + } 514 + 515 + private function getThisWeekRange() { 516 + $week_start = 0; 517 + $week_end = 6; 518 + 519 + $today = $this->getTodayMidnight(); 520 + $date_weekday = $today->format('w'); 521 + 522 + $days_from_week_start = $date_weekday - $week_start; 523 + $days_to_week_end = $week_end - $date_weekday + 1; 524 + 525 + $modify = '-'.$days_from_week_start.' days'; 526 + $week_start_date = id(clone $today)->modify($modify); 527 + 528 + $modify = '+'.$days_to_week_end.' days'; 529 + $week_end_date = id(clone $today)->modify($modify); 530 + 531 + return array($week_start_date, $week_end_date); 485 532 } 486 533 487 534 private function getDateTime() {
+13 -4
webroot/rsrc/css/phui/calendar/phui-calendar-month.css
··· 96 96 97 97 table.phui-calendar-view a.phui-calendar-date-number { 98 98 color: {$lightgreytext}; 99 - padding: 0 4px; 99 + padding: 4px; 100 100 display: inline-block; 101 101 min-width: 16px; 102 102 text-align: center; ··· 111 111 112 112 .phui-calendar-today-slot { 113 113 display: block; 114 - width: 100%; 115 114 height: 4px; 116 - padding: 0; 117 - margin: 0; 115 + position: absolute; 116 + left: 0; 117 + right: -1px; 118 + bottom: 0; 119 + } 120 + 121 + .phui-calendar-today-slot.last-weekday { 122 + right: 0px; 123 + } 124 + 125 + .phui-calendar-today-slot.phui-calendar-this-week { 126 + background-color: {$blueborder}; 118 127 } 119 128 120 129 .phui-calendar-today-slot.phui-calendar-today {