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

Calendar tooltips should always show start and end time of events.

Summary: Closes T8191, Calendar tooltips should always show start and end time of events.

Test Plan: Open month view, hover over, All day events, multi-day all day events, multi-day non-all-day events, and regular events. Tooltips should be "All day", "All day, <start> - <end>", "<start>-<end>", and "<start>-<end>", respectively.

Reviewers: epriestley, #blessed_reviewers, chad

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T8191

Differential Revision: https://secure.phabricator.com/D12846
This commit is contained in:
lkassianik 2015-05-14 12:35:34 -07:00
parent 2bc9dec85f
commit 87bf532c41
4 changed files with 38 additions and 11 deletions

View file

@ -122,7 +122,7 @@ return array(
'rsrc/css/layout/phabricator-source-code-view.css' => '2ceee894',
'rsrc/css/phui/calendar/phui-calendar-day.css' => '38891735',
'rsrc/css/phui/calendar/phui-calendar-list.css' => 'c1d0ca59',
'rsrc/css/phui/calendar/phui-calendar-month.css' => '75e6a2ee',
'rsrc/css/phui/calendar/phui-calendar-month.css' => 'e7ee38c6',
'rsrc/css/phui/calendar/phui-calendar.css' => '8675968e',
'rsrc/css/phui/phui-action-header-view.css' => '89c497e7',
'rsrc/css/phui/phui-action-list.css' => '4f4d09f2',
@ -763,7 +763,7 @@ return array(
'phui-calendar-css' => '8675968e',
'phui-calendar-day-css' => '38891735',
'phui-calendar-list-css' => 'c1d0ca59',
'phui-calendar-month-css' => '75e6a2ee',
'phui-calendar-month-css' => 'e7ee38c6',
'phui-crumbs-view-css' => '594d719e',
'phui-document-view-css' => '94d5dcd8',
'phui-feed-story-css' => 'c9f3a0b5',

View file

@ -157,6 +157,13 @@ final class AphrontFormDateControlValue extends Phobject {
);
}
public function getValueAsFormat($format) {
return phabricator_format_local_time(
$this->getEpoch(),
$this->viewer,
$format);
}
private function formatTime($epoch, $format) {
return phabricator_format_local_time(
$epoch,

View file

@ -105,12 +105,36 @@ final class PHUICalendarListView extends AphrontTagView {
Javelin::initBehavior('phabricator-tooltips');
if ($event->getMultiDay()) {
$tip = pht('%s, Until: %s', $event->getName(),
phabricator_date($event->getEpochEnd(), $this->getUser()));
$start = id(AphrontFormDateControlValue::newFromEpoch(
$this->getUser(),
$event->getEpochStart()));
$end = id(AphrontFormDateControlValue::newFromEpoch(
$this->getUser(),
$event->getEpochEnd()));
if ($event->getIsAllDay()) {
if ($start->getValueDay() == $end->getValueDay()) {
$tip = pht('All day');
} else {
$tip = pht(
'All day, %s - %s',
$start->getValueAsFormat('M j, Y'),
$end->getValueAsFormat('M j, Y'));
}
} else {
$tip = pht('%s, Until: %s', $event->getName(),
phabricator_time($event->getEpochEnd(), $this->getUser()));
if ($start->getValueDay() == $end->getValueDay() &&
$start->getValueMonth() == $end->getValueMonth() &&
$start->getValueYear() == $end->getValueYear()) {
$tip = pht(
'%s - %s',
$start->getValueAsFormat('g:i A'),
$end->getValueAsFormat('g:i A'));
} else {
$tip = pht(
'%s - %s',
$start->getValueAsFormat('M j, Y, g:i A'),
$end->getValueAsFormat('M j, Y, g:i A'));
}
}
$description = $event->getDescription();

View file

@ -88,10 +88,6 @@ table.phui-calendar-view td.phui-calendar-date-number-container {
text-align: right;
}
.phui-calendar-not-work-day {
background-color: {$lightgreybackground};
}
.phui-calendar-today-slot {
display: block;
width: 100%;