Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14003510
D13008.id.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
D13008.id.diff
View Options
diff --git a/src/infrastructure/time/PhabricatorTime.php b/src/infrastructure/time/PhabricatorTime.php
--- a/src/infrastructure/time/PhabricatorTime.php
+++ b/src/infrastructure/time/PhabricatorTime.php
@@ -72,4 +72,10 @@
return $today;
}
+ public static function getDateTimeFromEpoch($epoch, PhabricatorUser $viewer) {
+ $datetime = new DateTime('@'.$epoch);
+ $datetime->setTimeZone($viewer->getTimeZone());
+ return $datetime;
+ }
+
}
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
@@ -103,8 +103,16 @@
$event->getEpochEnd() > $day_start_epoch) {
if ($first_event_hour === null) {
- $first_event_hour = new DateTime('@'.$event->getEpochStart());
- $first_event_hour->setTimeZone($viewer->getTimeZone());
+ $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;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 27, 6:57 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6735868
Default Alt Text
D13008.id.diff (1 KB)
Attached To
Mode
D13008: Multi-day events should be correctly calculated for new js layout
Attached
Detach File
Event Timeline
Log In to Comment