Differential D17150 Diff 41243 src/applications/calendar/xaction/PhabricatorCalendarEventDateTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/xaction/PhabricatorCalendarEventDateTransaction.php
Show All 17 Lines | public function generateNewValue($object, $value) { | ||||
return $value->newPhutilDateTime() | return $value->newPhutilDateTime() | ||||
->setIsAllDay($editor->getNewIsAllDay()) | ->setIsAllDay($editor->getNewIsAllDay()) | ||||
->newAbsoluteDateTime() | ->newAbsoluteDateTime() | ||||
->toDictionary(); | ->toDictionary(); | ||||
} | } | ||||
public function getTransactionHasEffect($object, $old, $new) { | public function getTransactionHasEffect($object, $old, $new) { | ||||
// If either value is `null` (for example, when setting a recurring event | |||||
// end date for the first time) and the other value is not `null`, this | |||||
// transaction has an effect. | |||||
$has_null = (($old === null) || ($new === null)); | |||||
if ($has_null) { | |||||
return ($old !== $new); | |||||
} | |||||
$editor = $this->getEditor(); | $editor = $this->getEditor(); | ||||
$actor = $this->getActor(); | $actor = $this->getActor(); | ||||
$actor_timezone = $actor->getTimezoneIdentifier(); | $actor_timezone = $actor->getTimezoneIdentifier(); | ||||
// When an edit only changes the timezone of an event without materially | // When an edit only changes the timezone of an event without materially | ||||
// changing the absolute time, discard it. This can happen if two users in | // changing the absolute time, discard it. This can happen if two users in | ||||
// different timezones edit an event without rescheduling it. | // different timezones edit an event without rescheduling it. | ||||
Show All 36 Lines |