Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / calendar / xaction / PhabricatorCalendarEventUntilDateTransaction.php
blob3d0649eab834110a045effef81f452f5bc445602
1 <?php
3 final class PhabricatorCalendarEventUntilDateTransaction
4 extends PhabricatorCalendarEventDateTransaction {
6 const TRANSACTIONTYPE = 'calendar.recurrenceenddate';
8 public function generateOldValue($object) {
9 $editor = $this->getEditor();
11 $until = $object->newUntilDateTime();
12 if (!$until) {
13 return null;
16 return $until
17 ->newAbsoluteDateTime()
18 ->setIsAllDay($editor->getOldIsAllDay())
19 ->toDictionary();
22 public function applyInternalEffects($object, $value) {
23 $actor = $this->getActor();
24 $editor = $this->getEditor();
26 if ($value) {
27 $datetime = PhutilCalendarAbsoluteDateTime::newFromDictionary($value);
28 $datetime->setIsAllDay($editor->getNewIsAllDay());
29 $object->setUntilDateTime($datetime);
30 } else {
31 $object->setUntilDateTime(null);
35 public function getTitle() {
36 if ($this->getNewValue()) {
37 return pht(
38 '%s changed this event to repeat until %s.',
39 $this->renderAuthor(),
40 $this->renderNewDate());
41 } else {
42 return pht(
43 '%s changed this event to repeat forever.',
44 $this->renderAuthor());
48 public function getTitleForFeed() {
49 if ($this->getNewValue()) {
50 return pht(
51 '%s changed %s to repeat until %s.',
52 $this->renderAuthor(),
53 $this->renderObject(),
54 $this->renderNewDate());
55 } else {
56 return pht(
57 '%s changed %s to repeat forever.',
58 $this->renderAuthor(),
59 $this->renderObject());
63 protected function getInvalidDateMessage() {
64 return pht('Repeat until date is invalid.');