Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php
12256 views
1
<?php
2
3
final class PhabricatorCalendarEventEndDateTransaction
4
extends PhabricatorCalendarEventDateTransaction {
5
6
const TRANSACTIONTYPE = 'calendar.enddate';
7
8
public function generateOldValue($object) {
9
$editor = $this->getEditor();
10
11
return $object->newEndDateTimeForEdit()
12
->newAbsoluteDateTime()
13
->setIsAllDay($editor->getOldIsAllDay())
14
->toDictionary();
15
}
16
17
public function applyInternalEffects($object, $value) {
18
$actor = $this->getActor();
19
$editor = $this->getEditor();
20
21
$datetime = PhutilCalendarAbsoluteDateTime::newFromDictionary($value);
22
$datetime->setIsAllDay($editor->getNewIsAllDay());
23
24
$object->setEndDateTime($datetime);
25
}
26
27
public function shouldHide() {
28
if ($this->isCreateTransaction()) {
29
return true;
30
}
31
32
return false;
33
}
34
35
public function getTitle() {
36
return pht(
37
'%s changed the end date for this event from %s to %s.',
38
$this->renderAuthor(),
39
$this->renderOldDate(),
40
$this->renderNewDate());
41
}
42
43
public function getTitleForFeed() {
44
return pht(
45
'%s changed the end date for %s from %s to %s.',
46
$this->renderAuthor(),
47
$this->renderObject(),
48
$this->renderOldDate(),
49
$this->renderNewDate());
50
}
51
52
protected function getInvalidDateMessage() {
53
return pht('End date is invalid.');
54
}
55
56
}
57
58