Page MenuHomePhabricator

D16815.id40490.diff
No OneTemporary

D16815.id40490.diff

diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
--- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php
+++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
@@ -586,6 +586,9 @@
$min_date = $start->newPHPDateTime();
$max_date = $end->newPHPDateTime();
+ // Subtract one second since the stored date is exclusive.
+ $max_date = $max_date->modify('-1 second');
+
$min_day = $min_date->format('Y m d');
$max_day = $max_date->format('Y m d');
@@ -842,7 +845,11 @@
// If this is an all day event, we move the end date time forward to the
// first second of the following day. This is consistent with what users
// expect: an all day event from "Nov 1" to "Nov 1" lasts the entire day.
- if ($this->getIsAllDay()) {
+
+ // For imported events, the end date is already stored with this
+ // adjustment.
+
+ if ($this->getIsAllDay() && !$this->isImportedEvent()) {
$datetime = $datetime
->newAbsoluteDateTime()
->setHour(0)
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
@@ -198,8 +198,11 @@
$viewer,
$event->getEpochEnd()));
+ $end_date = $end->getDateTime();
+ $end_date = $end_date->modify('-1 second');
+
$start_date = $start->getDateTime()->format('m d Y');
- $end_date = $end->getDateTime()->format('m d Y');
+ $end_date = $end_date->format('m d Y');
if ($event->getIsAllDay()) {
if ($start_date == $end_date) {

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 12, 2:30 AM (6 d, 7 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6712690
Default Alt Text
D16815.id40490.diff (1 KB)

Event Timeline