Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14011296
D8332.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8332.id.diff
View Options
Index: src/applications/calendar/view/AphrontCalendarEventView.php
===================================================================
--- src/applications/calendar/view/AphrontCalendarEventView.php
+++ src/applications/calendar/view/AphrontCalendarEventView.php
@@ -71,6 +71,22 @@
}
}
+ public function getAllDay() {
+ $time = (60 * 60 * 22);
+ if (($this->getEpochEnd() - $this->getEpochStart()) >= $time) {
+ return true;
+ }
+ return false;
+ }
+
+ public function getMultiDay() {
+ $nextday = strtotime('12:00 AM Tomorrow', $this->getEpochStart());
+ if ($this->getEpochEnd() > $nextday) {
+ return true;
+ }
+ return false;
+ }
+
public function render() {
throw new Exception("Events are only rendered indirectly.");
}
Index: src/view/phui/calendar/PHUICalendarListView.php
===================================================================
--- src/view/phui/calendar/PHUICalendarListView.php
+++ src/view/phui/calendar/PHUICalendarListView.php
@@ -32,16 +32,12 @@
$events = msort($this->events, 'getEpochStart');
- // All Day Event (well, 23 hours, 59 minutes worth)
- $timespan = ((3600 * 24) - 60);
-
$singletons = array();
$allday = false;
foreach ($events as $event) {
$color = $event->getColor();
- $length = ($event->getEpochEnd() - $event->getEpochStart());
- if ($length >= $timespan) {
+ if ($event->getAllDay()) {
$timelabel = pht('All Day');
} else {
$timelabel = phabricator_time(
@@ -99,10 +95,7 @@
Javelin::initBehavior('phabricator-tooltips');
- // Multiple Days
- $timespan = ((3600 * 24) + 60);
- $length = ($event->getEpochEnd() - $event->getEpochStart());
- if ($length >= $timespan) {
+ if ($event->getMultiDay()) {
$tip = pht('%s, Until: %s', $event->getName(),
phabricator_date($event->getEpochEnd(), $this->getUser()));
} else {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 1, 10:40 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6723839
Default Alt Text
D8332.id.diff (1 KB)
Attached To
Mode
D8332: Add allday, multiday logic to AphrontEventView
Attached
Detach File
Event Timeline
Log In to Comment