Page MenuHomePhabricator

D12846.diff
No OneTemporary

D12846.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -122,7 +122,7 @@
'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 @@
'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',
diff --git a/src/view/form/control/AphrontFormDateControlValue.php b/src/view/form/control/AphrontFormDateControlValue.php
--- a/src/view/form/control/AphrontFormDateControlValue.php
+++ b/src/view/form/control/AphrontFormDateControlValue.php
@@ -157,6 +157,13 @@
);
}
+ 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,
diff --git a/src/view/phui/calendar/PHUICalendarListView.php b/src/view/phui/calendar/PHUICalendarListView.php
--- a/src/view/phui/calendar/PHUICalendarListView.php
+++ b/src/view/phui/calendar/PHUICalendarListView.php
@@ -105,12 +105,36 @@
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();
diff --git a/webroot/rsrc/css/phui/calendar/phui-calendar-month.css b/webroot/rsrc/css/phui/calendar/phui-calendar-month.css
--- a/webroot/rsrc/css/phui/calendar/phui-calendar-month.css
+++ b/webroot/rsrc/css/phui/calendar/phui-calendar-month.css
@@ -88,10 +88,6 @@
text-align: right;
}
-.phui-calendar-not-work-day {
- background-color: {$lightgreybackground};
-}
-
.phui-calendar-today-slot {
display: block;
width: 100%;

File Metadata

Mime Type
text/plain
Expires
Sun, Jul 27, 4:46 AM (9 h, 10 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8641130
Default Alt Text
D12846.diff (3 KB)

Event Timeline