Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15367860
D16777.id40413.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D16777.id40413.diff
View Options
diff --git a/src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.php b/src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.php
--- a/src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.php
+++ b/src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.php
@@ -119,7 +119,7 @@
->setDescription(pht('End time of the event.'))
->setConduitDescription(pht('Change the end time of the event.'))
->setConduitTypeDescription(pht('New event end time.'))
- ->setValue($object->getEndDateTimeEpoch()),
+ ->setValue($object->newEndDateTimeForEdit()->getEpoch()),
id(new PhabricatorBoolEditField())
->setKey('cancelled')
->setOptions(pht('Active'), pht('Cancelled'))
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
@@ -857,7 +857,7 @@
return $this->newStartDateTime()->getEpoch();
}
- public function newEndDateTime() {
+ public function newEndDateTimeForEdit() {
$datetime = $this->getParameter('endDateTime');
if ($datetime) {
return $this->newDateTimeFromDictionary($datetime);
@@ -867,6 +867,25 @@
return $this->newDateTimeFromEpoch($epoch);
}
+ public function newEndDateTime() {
+ $datetime = $this->newEndDateTimeForEdit();
+
+ // 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()) {
+ $datetime = $datetime
+ ->newAbsoluteDateTime()
+ ->setHour(0)
+ ->setMinute(0)
+ ->setSecond(0)
+ ->newRelativeDateTime('P1D')
+ ->newAbsoluteDateTime();
+ }
+
+ return $datetime;
+ }
+
public function getEndDateTimeEpoch() {
return $this->newEndDateTime()->getEpoch();
}
diff --git a/src/applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php b/src/applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php
--- a/src/applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php
+++ b/src/applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php
@@ -7,7 +7,7 @@
public function generateOldValue($object) {
// TODO: Upgrade this.
- return $object->getEndDateTimeEpoch();
+ return $object->newEndDateTimeForEdit()->getEpoch();
}
public function applyInternalEffects($object, $value) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 12, 9:29 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7263954
Default Alt Text
D16777.id40413.diff (2 KB)
Attached To
Mode
D16777: Make calendar intepret all-day dates in a more consistent way
Attached
Detach File
Event Timeline
Log In to Comment