Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14347891
D13013.id31385.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13013.id31385.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D13013: Fix day view start hour
Attached
Detach File
Event Timeline
Log In to Comment