Page MenuHomePhabricator

Calendar UI doesn't honor user time format preferences in day view
Closed, ResolvedPublic

Description

The following patch does the trick, but I'm not sure, if that's the right way to fix it.
(Maybe "hour_meridian" should be renamed to "hour_in_view" or something like that?)

Regards,
Peter

--- a/src/view/phui/calendar/PHUICalendarDayView.php
+++ b/src/view/phui/calendar/PHUICalendarDayView.php
@@ -61,7 +61,7 @@ final class PHUICalendarDayView extends AphrontView {
     foreach ($hours as $hour) {
       $js_hours[] = array(
         'hour' => $hour->format('G'),
-        'hour_meridian' => $hour->format('g A'),
+        'hour_meridian' => phabricator_time($hour->getTimestamp(), $viewer),
       );
     }