1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00

Give Calendar days from adjacent months a background color hint

Summary:
Ref T11326. When viewing "February", add a class to dates in January and March to let them be styled a little differently as a UI hint.

For now, I've given them a grey background. (Calendar.app changes the date number color instead.)

Test Plan: {F1738990}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11326

Differential Revision: https://secure.phabricator.com/D16336
This commit is contained in:
epriestley 2016-07-27 07:23:07 -07:00
parent ba00022730
commit 89f6764e1b
3 changed files with 16 additions and 4 deletions

View file

@ -117,7 +117,7 @@ return array(
'rsrc/css/layout/phabricator-source-code-view.css' => 'cbeef983',
'rsrc/css/phui/calendar/phui-calendar-day.css' => 'f15bb6d6',
'rsrc/css/phui/calendar/phui-calendar-list.css' => '5d89cd71',
'rsrc/css/phui/calendar/phui-calendar-month.css' => '31cec731',
'rsrc/css/phui/calendar/phui-calendar-month.css' => '8e10e92c',
'rsrc/css/phui/calendar/phui-calendar.css' => 'daadaf39',
'rsrc/css/phui/phui-action-list.css' => 'c5eba19d',
'rsrc/css/phui/phui-action-panel.css' => '91c7b835',
@ -830,7 +830,7 @@ return array(
'phui-calendar-css' => 'daadaf39',
'phui-calendar-day-css' => 'f15bb6d6',
'phui-calendar-list-css' => '5d89cd71',
'phui-calendar-month-css' => '31cec731',
'phui-calendar-month-css' => '8e10e92c',
'phui-chart-css' => '6bf6f78e',
'phui-crumbs-view-css' => 'b4fa5755',
'phui-curtain-view-css' => '7148ae25',

View file

@ -65,7 +65,6 @@ final class PHUICalendarMonthView extends AphrontView {
foreach ($days as $day) {
$day_number = $day->format('j');
$class = 'phui-calendar-month-day';
$weekday = $day->format('w');
$day->setTime(0, 0, 0);
@ -115,13 +114,20 @@ final class PHUICalendarMonthView extends AphrontView {
$day_id = $day->format('Ymd');
$classes = array();
if ($day->format('m') != $this->month) {
$classes[] = 'phui-calendar-month-adjacent';
}
$classes = implode(' ', $classes);
$cell_lists[$day_id] = array(
'dayID' => $day_id,
'list' => $list,
'date' => $day,
'dayURI' => $uri,
'count' => count($all_day_events) + count($list_events),
'class' => $class,
'class' => $classes,
);
}
@ -219,6 +225,7 @@ final class PHUICalendarMonthView extends AphrontView {
$classes = array();
$classes[] = 'phui-calendar-month-event-list';
$classes[] = 'phui-calendar-month-day';
$classes[] = $event_list['class'];
$classes = implode(' ', $classes);
@ -285,6 +292,7 @@ final class PHUICalendarMonthView extends AphrontView {
$classes = array();
$classes[] = 'phui-calendar-month-number';
$classes[] = $event_list['class'];
if ($date) {
if ($this->isDateInCurrentWeek($date)) {

View file

@ -222,3 +222,7 @@ td.phui-calendar-month-number {
.device-desktop td.phui-calendar-month-number.calendar-hover {
background: {$lightblue};
}
.phui-calendar-month-adjacent {
background: {$greybackground};
}