mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 10:42:41 +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:
parent
2bc9dec85f
commit
87bf532c41
4 changed files with 38 additions and 11 deletions
|
@ -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' => '38891735',
|
'rsrc/css/phui/calendar/phui-calendar-day.css' => '38891735',
|
||||||
'rsrc/css/phui/calendar/phui-calendar-list.css' => 'c1d0ca59',
|
'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/calendar/phui-calendar.css' => '8675968e',
|
||||||
'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' => '8675968e',
|
'phui-calendar-css' => '8675968e',
|
||||||
'phui-calendar-day-css' => '38891735',
|
'phui-calendar-day-css' => '38891735',
|
||||||
'phui-calendar-list-css' => 'c1d0ca59',
|
'phui-calendar-list-css' => 'c1d0ca59',
|
||||||
'phui-calendar-month-css' => '75e6a2ee',
|
'phui-calendar-month-css' => 'e7ee38c6',
|
||||||
'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',
|
||||||
|
|
|
@ -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) {
|
private function formatTime($epoch, $format) {
|
||||||
return phabricator_format_local_time(
|
return phabricator_format_local_time(
|
||||||
$epoch,
|
$epoch,
|
||||||
|
|
|
@ -105,12 +105,36 @@ final class PHUICalendarListView extends AphrontTagView {
|
||||||
|
|
||||||
Javelin::initBehavior('phabricator-tooltips');
|
Javelin::initBehavior('phabricator-tooltips');
|
||||||
|
|
||||||
if ($event->getMultiDay()) {
|
$start = id(AphrontFormDateControlValue::newFromEpoch(
|
||||||
$tip = pht('%s, Until: %s', $event->getName(),
|
$this->getUser(),
|
||||||
phabricator_date($event->getEpochEnd(), $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 {
|
} else {
|
||||||
$tip = pht('%s, Until: %s', $event->getName(),
|
if ($start->getValueDay() == $end->getValueDay() &&
|
||||||
phabricator_time($event->getEpochEnd(), $this->getUser()));
|
$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();
|
$description = $event->getDescription();
|
||||||
|
|
|
@ -88,10 +88,6 @@ table.phui-calendar-view td.phui-calendar-date-number-container {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phui-calendar-not-work-day {
|
|
||||||
background-color: {$lightgreybackground};
|
|
||||||
}
|
|
||||||
|
|
||||||
.phui-calendar-today-slot {
|
.phui-calendar-today-slot {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
Loading…
Reference in a new issue