Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/calendar/PHUICalendarListView.php
Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | private function getEventTooltip(AphrontCalendarEventView $event) { | ||||
$start = id(AphrontFormDateControlValue::newFromEpoch( | $start = id(AphrontFormDateControlValue::newFromEpoch( | ||||
$this->getUser(), | $this->getUser(), | ||||
$event->getEpochStart())); | $event->getEpochStart())); | ||||
$end = id(AphrontFormDateControlValue::newFromEpoch( | $end = id(AphrontFormDateControlValue::newFromEpoch( | ||||
$this->getUser(), | $this->getUser(), | ||||
$event->getEpochEnd())); | $event->getEpochEnd())); | ||||
$start_date = $start->getDateTime()->format('m d Y'); | |||||
$end_date = $end->getDateTime()->format('m d Y'); | |||||
if ($event->getIsAllDay()) { | if ($event->getIsAllDay()) { | ||||
if ($start->getValueDay() == $end->getValueDay()) { | if ($start_date == $end_date) { | ||||
$tip = pht('All day'); | $tip = pht('All day'); | ||||
} else { | } else { | ||||
$tip = pht( | $tip = pht( | ||||
'All day, %s - %s', | 'All day, %s - %s', | ||||
$start->getValueAsFormat('M j, Y'), | $start->getValueAsFormat('M j, Y'), | ||||
$end->getValueAsFormat('M j, Y')); | $end->getValueAsFormat('M j, Y')); | ||||
} | } | ||||
} else { | } else { | ||||
if ($start->getValueDay() == $end->getValueDay() && | if ($start->getValueDate() == $end->getValueDate()) { | ||||
$start->getValueMonth() == $end->getValueMonth() && | |||||
$start->getValueYear() == $end->getValueYear()) { | |||||
$tip = pht( | $tip = pht( | ||||
'%s - %s', | '%s - %s', | ||||
$start->getValueAsFormat('g:i A'), | $start->getValueAsFormat('g:i A'), | ||||
$end->getValueAsFormat('g:i A')); | $end->getValueAsFormat('g:i A')); | ||||
} else { | } else { | ||||
$tip = pht( | $tip = pht( | ||||
'%s - %s', | '%s - %s', | ||||
$start->getValueAsFormat('M j, Y, g:i A'), | $start->getValueAsFormat('M j, Y, g:i A'), | ||||
Show All 15 Lines |