mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 20:40:56 +01:00
Calendar event detail view should show no time for all day events, and should show only one time field for one day events.
Summary: Ref T8021, Calendar event detail view should show no time for all day events, and should show only one time field for one day events Test Plan: Open all-day event, event should show "Time" field with not start/end dates. Two day events should show start and end days, not times. Normal events should show old way of displaying start and end times. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8021 Differential Revision: https://secure.phabricator.com/D12768
This commit is contained in:
parent
559ba4e944
commit
da52a27b42
1 changed files with 24 additions and 6 deletions
|
@ -179,13 +179,31 @@ final class PhabricatorCalendarEventViewController
|
|||
->setUser($viewer)
|
||||
->setObject($event);
|
||||
|
||||
$properties->addProperty(
|
||||
pht('Starts'),
|
||||
phabricator_datetime($event->getDateFrom(), $viewer));
|
||||
if ($event->getIsAllDay()) {
|
||||
$date_start = phabricator_date($event->getDateFrom(), $viewer);
|
||||
$date_end = phabricator_date($event->getDateTo(), $viewer);
|
||||
|
||||
$properties->addProperty(
|
||||
pht('Ends'),
|
||||
phabricator_datetime($event->getDateTo(), $viewer));
|
||||
if ($date_start == $date_end) {
|
||||
$properties->addProperty(
|
||||
pht('Time'),
|
||||
phabricator_date($event->getDateFrom(), $viewer));
|
||||
} else {
|
||||
$properties->addProperty(
|
||||
pht('Starts'),
|
||||
phabricator_date($event->getDateFrom(), $viewer));
|
||||
$properties->addProperty(
|
||||
pht('Ends'),
|
||||
phabricator_date($event->getDateTo(), $viewer));
|
||||
}
|
||||
} else {
|
||||
$properties->addProperty(
|
||||
pht('Starts'),
|
||||
phabricator_datetime($event->getDateFrom(), $viewer));
|
||||
|
||||
$properties->addProperty(
|
||||
pht('Ends'),
|
||||
phabricator_datetime($event->getDateTo(), $viewer));
|
||||
}
|
||||
|
||||
$properties->addProperty(
|
||||
pht('Host'),
|
||||
|
|
Loading…
Reference in a new issue