1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 11:30:55 +01:00
phorge-phorge/src/applications/calendar/xaction/PhabricatorCalendarEventUntilDateTransaction.php

52 lines
1.2 KiB
PHP
Raw Normal View History

<?php
final class PhabricatorCalendarEventUntilDateTransaction
extends PhabricatorCalendarEventDateTransaction {
const TRANSACTIONTYPE = 'calendar.recurrenceenddate';
public function generateOldValue($object) {
$editor = $this->getEditor();
$until = $object->newUntilDateTime();
if (!$until) {
return null;
}
return $until
->newAbsoluteDateTime()
->setIsAllDay($editor->getOldIsAllDay())
->toDictionary();
}
public function applyInternalEffects($object, $value) {
$actor = $this->getActor();
$editor = $this->getEditor();
$datetime = PhutilCalendarAbsoluteDateTime::newFromDictionary($value);
$datetime->setIsAllDay($editor->getNewIsAllDay());
$object->setUntilDateTime($datetime);
}
public function getTitle() {
return pht(
'%s changed this event to repeat until %s.',
$this->renderAuthor(),
$this->renderNewDate());
}
public function getTitleForFeed() {
return pht(
'%s changed %s to repeat until %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderNewDate());
}
protected function getInvalidDateMessage() {
return pht('Repeat until date is invalid.');
}
}