Page MenuHomePhabricator

D16815.diff
No OneTemporary

D16815.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
@@ -593,6 +593,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');
@@ -849,7 +852,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
Sat, Oct 19, 11:23 PM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6718001
Default Alt Text
D16815.diff (1 KB)

Event Timeline