mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +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,6 +179,23 @@ final class PhabricatorCalendarEventViewController
|
||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
->setObject($event);
|
->setObject($event);
|
||||||
|
|
||||||
|
if ($event->getIsAllDay()) {
|
||||||
|
$date_start = phabricator_date($event->getDateFrom(), $viewer);
|
||||||
|
$date_end = phabricator_date($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(
|
$properties->addProperty(
|
||||||
pht('Starts'),
|
pht('Starts'),
|
||||||
phabricator_datetime($event->getDateFrom(), $viewer));
|
phabricator_datetime($event->getDateFrom(), $viewer));
|
||||||
|
@ -186,6 +203,7 @@ final class PhabricatorCalendarEventViewController
|
||||||
$properties->addProperty(
|
$properties->addProperty(
|
||||||
pht('Ends'),
|
pht('Ends'),
|
||||||
phabricator_datetime($event->getDateTo(), $viewer));
|
phabricator_datetime($event->getDateTo(), $viewer));
|
||||||
|
}
|
||||||
|
|
||||||
$properties->addProperty(
|
$properties->addProperty(
|
||||||
pht('Host'),
|
pht('Host'),
|
||||||
|
|
Loading…
Reference in a new issue