Page MenuHomePhabricator

D13013.id31385.diff
No OneTemporary

D13013.id31385.diff

diff --git a/src/view/phui/calendar/PHUICalendarDayView.php b/src/view/phui/calendar/PHUICalendarDayView.php
--- a/src/view/phui/calendar/PHUICalendarDayView.php
+++ b/src/view/phui/calendar/PHUICalendarDayView.php
@@ -91,6 +91,7 @@
$this->events = msort($this->events, 'getEpochStart');
$first_event_hour = $this->getDateTime()->setTime(8, 0, 0);
+ $midnight = $this->getDateTime()->setTime(0, 0, 0);
foreach ($this->events as $event) {
if ($event->getIsAllDay()) {
@@ -99,21 +100,17 @@
if ($event->getEpochStart() <= $day_end_epoch &&
$event->getEpochEnd() > $day_start_epoch) {
- if ($first_event_hour === null) {
+ if ($event->getEpochStart() < $midnight->format('U') &&
+ $event->getEpochEnd() > $midnight->format('U')) {
+ $first_event_hour = clone $midnight;
+ }
+
+ if ($event->getEpochStart() < $first_event_hour->format('U') &&
+ $event->getEpochStart() > $midnight->format('U')) {
$first_event_hour = PhabricatorTime::getDateTimeFromEpoch(
$event->getEpochStart(),
$viewer);
-
- $midnight = $this->getDateTime()->setTime(0, 0, 0);
-
- if ($first_event_hour->format('U') < $midnight->format('U')) {
- $first_event_hour = clone $midnight;
- }
-
- $eight_am = $this->getDateTime()->setTime(8, 0, 0);
- if ($eight_am->format('U') < $first_event_hour->format('U')) {
- $first_event_hour = clone $eight_am;
- }
+ $first_event_hour->setTime($first_event_hour->format('h'), 0, 0);
}
$event_start = max($event->getEpochStart(), $day_start_epoch);

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 3:52 AM (20 h, 53 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6909436
Default Alt Text
D13013.id31385.diff (1 KB)

Event Timeline