1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 01:10:58 +01:00

Week day names in Calendar month view should be full names on desktop and short names on device

Summary: Ref T8186, Week day names in Calendar month view should be full names on desktop and short names on device

Test Plan: Open month view, desktop view should display Monday, Tuesday, etc. Shrink browser, days should be Mon, Tue, etc.

Reviewers: chad, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T8186

Differential Revision: https://secure.phabricator.com/D12859
This commit is contained in:
lkassianik 2015-05-15 10:32:47 -07:00
parent e185d8fe02
commit 6620ebe553
3 changed files with 42 additions and 10 deletions

View file

@ -122,7 +122,7 @@ return array(
'rsrc/css/layout/phabricator-source-code-view.css' => '2ceee894', 'rsrc/css/layout/phabricator-source-code-view.css' => '2ceee894',
'rsrc/css/phui/calendar/phui-calendar-day.css' => '3b4a65d8', 'rsrc/css/phui/calendar/phui-calendar-day.css' => '3b4a65d8',
'rsrc/css/phui/calendar/phui-calendar-list.css' => '840baa8d', 'rsrc/css/phui/calendar/phui-calendar-list.css' => '840baa8d',
'rsrc/css/phui/calendar/phui-calendar-month.css' => '450c37ea', 'rsrc/css/phui/calendar/phui-calendar-month.css' => '9fde32d1',
'rsrc/css/phui/calendar/phui-calendar.css' => '8345be98', 'rsrc/css/phui/calendar/phui-calendar.css' => '8345be98',
'rsrc/css/phui/phui-action-header-view.css' => '89c497e7', 'rsrc/css/phui/phui-action-header-view.css' => '89c497e7',
'rsrc/css/phui/phui-action-list.css' => '4f4d09f2', 'rsrc/css/phui/phui-action-list.css' => '4f4d09f2',
@ -763,7 +763,7 @@ return array(
'phui-calendar-css' => '8345be98', 'phui-calendar-css' => '8345be98',
'phui-calendar-day-css' => '3b4a65d8', 'phui-calendar-day-css' => '3b4a65d8',
'phui-calendar-list-css' => '840baa8d', 'phui-calendar-list-css' => '840baa8d',
'phui-calendar-month-css' => '450c37ea', 'phui-calendar-month-css' => '9fde32d1',
'phui-crumbs-view-css' => '594d719e', 'phui-crumbs-view-css' => '594d719e',
'phui-document-view-css' => '94d5dcd8', 'phui-document-view-css' => '94d5dcd8',
'phui-feed-story-css' => 'c9f3a0b5', 'phui-feed-story-css' => 'c9f3a0b5',

View file

@ -294,16 +294,36 @@ final class PHUICalendarMonthView extends AphrontView {
'tr', 'tr',
array('class' => 'phui-calendar-day-of-week-header'), array('class' => 'phui-calendar-day-of-week-header'),
array( array(
phutil_tag('th', array(), pht('Sun')), $this->getDayHeader(pht('Sun'), pht('Sunday')),
phutil_tag('th', array(), pht('Mon')), $this->getDayHeader(pht('Mon'), pht('Monday')),
phutil_tag('th', array(), pht('Tue')), $this->getDayHeader(pht('Tue'), pht('Tuesday')),
phutil_tag('th', array(), pht('Wed')), $this->getDayHeader(pht('Wed'), pht('Wednesday')),
phutil_tag('th', array(), pht('Thu')), $this->getDayHeader(pht('Thu'), pht('Thursday')),
phutil_tag('th', array(), pht('Fri')), $this->getDayHeader(pht('Fri'), pht('Friday')),
phutil_tag('th', array(), pht('Sat')), $this->getDayHeader(pht('Sat'), pht('Saturday')),
)); ));
} }
private function getDayHeader($short, $long) {
$day = array();
$day[] = phutil_tag(
'span',
array(
'class' => 'long-weekday-name',
),
$long);
$day[] = phutil_tag(
'span',
array(
'class' => 'short-weekday-name',
),
$short);
return phutil_tag(
'th',
array(),
$day);
}
private function renderCalendarHeader(DateTime $date) { private function renderCalendarHeader(DateTime $date) {
$button_bar = null; $button_bar = null;

View file

@ -10,12 +10,24 @@
tr.phui-calendar-day-of-week-header th { tr.phui-calendar-day-of-week-header th {
text-align: center; text-align: center;
font-size: 11px; font-size: 13px;
padding: 3px; padding: 3px;
color: {$lightbluetext}; color: {$lightbluetext};
background: {$lightgreybackground}; background: {$lightgreybackground};
} }
.device tr.phui-calendar-day-of-week-header th .long-weekday-name {
display: none;
}
tr.phui-calendar-day-of-week-header th .short-weekday-name {
display: none;
}
.device tr.phui-calendar-day-of-week-header th .short-weekday-name {
display: inline;
}
table.phui-calendar-view td { table.phui-calendar-view td {
border: solid #dfdfdf; border: solid #dfdfdf;
border-width: 1px 1px 0 1px; border-width: 1px 1px 0 1px;