Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/calendar/notifications/PhabricatorCalendarEventNotificationView.php
12256 views
1
<?php
2
3
final class PhabricatorCalendarEventNotificationView
4
extends Phobject {
5
6
private $viewer;
7
private $event;
8
private $epoch;
9
private $dateTime;
10
11
public function setViewer(PhabricatorUser $viewer) {
12
$this->viewer = $viewer;
13
return $this;
14
}
15
16
public function getViewer() {
17
return $this->viewer;
18
}
19
20
public function setEvent(PhabricatorCalendarEvent $event) {
21
$this->event = $event;
22
return $this;
23
}
24
25
public function getEvent() {
26
return $this->event;
27
}
28
29
public function setEpoch($epoch) {
30
$this->epoch = $epoch;
31
return $this;
32
}
33
34
public function getEpoch() {
35
return $this->epoch;
36
}
37
38
public function setDateTime(PhutilCalendarDateTime $date_time) {
39
$this->dateTime = $date_time;
40
return $this;
41
}
42
43
public function getDateTime() {
44
return $this->dateTime;
45
}
46
47
public function getDisplayMinutes() {
48
$epoch = $this->getEpoch();
49
$now = PhabricatorTime::getNow();
50
$minutes = (int)ceil(($epoch - $now) / 60);
51
return new PhutilNumber($minutes);
52
}
53
54
public function getDisplayTime() {
55
$viewer = $this->getViewer();
56
57
$epoch = $this->getEpoch();
58
return phabricator_datetime($epoch, $viewer);
59
}
60
61
public function getDisplayTimeWithTimezone() {
62
$viewer = $this->getViewer();
63
64
$epoch = $this->getEpoch();
65
return phabricator_datetimezone($epoch, $viewer);
66
}
67
68
69
}
70
71