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:
parent
ba00022730
commit
89f6764e1b
3 changed files with 16 additions and 4 deletions
|
@ -117,7 +117,7 @@ return array(
|
||||||
'rsrc/css/layout/phabricator-source-code-view.css' => 'cbeef983',
|
'rsrc/css/layout/phabricator-source-code-view.css' => 'cbeef983',
|
||||||
'rsrc/css/phui/calendar/phui-calendar-day.css' => 'f15bb6d6',
|
'rsrc/css/phui/calendar/phui-calendar-day.css' => 'f15bb6d6',
|
||||||
'rsrc/css/phui/calendar/phui-calendar-list.css' => '5d89cd71',
|
'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/calendar/phui-calendar.css' => 'daadaf39',
|
||||||
'rsrc/css/phui/phui-action-list.css' => 'c5eba19d',
|
'rsrc/css/phui/phui-action-list.css' => 'c5eba19d',
|
||||||
'rsrc/css/phui/phui-action-panel.css' => '91c7b835',
|
'rsrc/css/phui/phui-action-panel.css' => '91c7b835',
|
||||||
|
@ -830,7 +830,7 @@ return array(
|
||||||
'phui-calendar-css' => 'daadaf39',
|
'phui-calendar-css' => 'daadaf39',
|
||||||
'phui-calendar-day-css' => 'f15bb6d6',
|
'phui-calendar-day-css' => 'f15bb6d6',
|
||||||
'phui-calendar-list-css' => '5d89cd71',
|
'phui-calendar-list-css' => '5d89cd71',
|
||||||
'phui-calendar-month-css' => '31cec731',
|
'phui-calendar-month-css' => '8e10e92c',
|
||||||
'phui-chart-css' => '6bf6f78e',
|
'phui-chart-css' => '6bf6f78e',
|
||||||
'phui-crumbs-view-css' => 'b4fa5755',
|
'phui-crumbs-view-css' => 'b4fa5755',
|
||||||
'phui-curtain-view-css' => '7148ae25',
|
'phui-curtain-view-css' => '7148ae25',
|
||||||
|
|
|
@ -65,7 +65,6 @@ final class PHUICalendarMonthView extends AphrontView {
|
||||||
foreach ($days as $day) {
|
foreach ($days as $day) {
|
||||||
$day_number = $day->format('j');
|
$day_number = $day->format('j');
|
||||||
|
|
||||||
$class = 'phui-calendar-month-day';
|
|
||||||
$weekday = $day->format('w');
|
$weekday = $day->format('w');
|
||||||
|
|
||||||
$day->setTime(0, 0, 0);
|
$day->setTime(0, 0, 0);
|
||||||
|
@ -115,13 +114,20 @@ final class PHUICalendarMonthView extends AphrontView {
|
||||||
|
|
||||||
$day_id = $day->format('Ymd');
|
$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(
|
$cell_lists[$day_id] = array(
|
||||||
'dayID' => $day_id,
|
'dayID' => $day_id,
|
||||||
'list' => $list,
|
'list' => $list,
|
||||||
'date' => $day,
|
'date' => $day,
|
||||||
'dayURI' => $uri,
|
'dayURI' => $uri,
|
||||||
'count' => count($all_day_events) + count($list_events),
|
'count' => count($all_day_events) + count($list_events),
|
||||||
'class' => $class,
|
'class' => $classes,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,6 +225,7 @@ final class PHUICalendarMonthView extends AphrontView {
|
||||||
|
|
||||||
$classes = array();
|
$classes = array();
|
||||||
$classes[] = 'phui-calendar-month-event-list';
|
$classes[] = 'phui-calendar-month-event-list';
|
||||||
|
$classes[] = 'phui-calendar-month-day';
|
||||||
$classes[] = $event_list['class'];
|
$classes[] = $event_list['class'];
|
||||||
$classes = implode(' ', $classes);
|
$classes = implode(' ', $classes);
|
||||||
|
|
||||||
|
@ -285,6 +292,7 @@ final class PHUICalendarMonthView extends AphrontView {
|
||||||
|
|
||||||
$classes = array();
|
$classes = array();
|
||||||
$classes[] = 'phui-calendar-month-number';
|
$classes[] = 'phui-calendar-month-number';
|
||||||
|
$classes[] = $event_list['class'];
|
||||||
|
|
||||||
if ($date) {
|
if ($date) {
|
||||||
if ($this->isDateInCurrentWeek($date)) {
|
if ($this->isDateInCurrentWeek($date)) {
|
||||||
|
|
|
@ -222,3 +222,7 @@ td.phui-calendar-month-number {
|
||||||
.device-desktop td.phui-calendar-month-number.calendar-hover {
|
.device-desktop td.phui-calendar-month-number.calendar-hover {
|
||||||
background: {$lightblue};
|
background: {$lightblue};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.phui-calendar-month-adjacent {
|
||||||
|
background: {$greybackground};
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue