1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 09:20:58 +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:
lkassianik 2015-05-08 08:08:26 -07:00
parent 559ba4e944
commit da52a27b42

View file

@ -179,13 +179,31 @@ final class PhabricatorCalendarEventViewController
->setUser($viewer) ->setUser($viewer)
->setObject($event); ->setObject($event);
$properties->addProperty( if ($event->getIsAllDay()) {
pht('Starts'), $date_start = phabricator_date($event->getDateFrom(), $viewer);
phabricator_datetime($event->getDateFrom(), $viewer)); $date_end = phabricator_date($event->getDateTo(), $viewer);
$properties->addProperty( if ($date_start == $date_end) {
pht('Ends'), $properties->addProperty(
phabricator_datetime($event->getDateTo(), $viewer)); 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( $properties->addProperty(
pht('Host'), pht('Host'),