From 8062423271c76d3482d7e7e51b62286f246fe71c Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 13 Jul 2016 10:26:18 -0700 Subject: [PATCH] Respect 12 hour vs 24 hour time formats in Calendar day views Summary: Fixes T9202. Test Plan: - Viewed day in 12-hour, saw "8:00 PM". - Viewed day in 24-hour, saw "16:00". Reviewers: chad Reviewed By: chad Maniphest Tasks: T9202, T10932 Differential Revision: https://secure.phabricator.com/D16290 --- resources/celerity/map.php | 4 ++-- src/view/phui/calendar/PHUICalendarDayView.php | 2 +- webroot/rsrc/js/application/calendar/behavior-day-view.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 0aa02f6894..31a56d7e70 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -362,7 +362,7 @@ return array( 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761', 'rsrc/js/application/aphlict/behavior-desktop-notifications-control.js' => 'edd1ba66', 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', - 'rsrc/js/application/calendar/behavior-day-view.js' => '5c46cff2', + 'rsrc/js/application/calendar/behavior-day-view.js' => '1a5bb063', 'rsrc/js/application/calendar/behavior-event-all-day.js' => '38dcf3c8', 'rsrc/js/application/calendar/behavior-recurring-edit.js' => '5f1c4d5f', 'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408', @@ -603,7 +603,7 @@ return array( 'javelin-behavior-dashboard-move-panels' => '019f36c4', 'javelin-behavior-dashboard-query-panel-select' => '453c5375', 'javelin-behavior-dashboard-tab-panel' => 'd4eecc63', - 'javelin-behavior-day-view' => '5c46cff2', + 'javelin-behavior-day-view' => '1a5bb063', 'javelin-behavior-desktop-notifications-control' => 'edd1ba66', 'javelin-behavior-detect-timezone' => '4c193c96', 'javelin-behavior-device' => 'bb1dd507', diff --git a/src/view/phui/calendar/PHUICalendarDayView.php b/src/view/phui/calendar/PHUICalendarDayView.php index d7b5f9bda2..ee9e8b5cf4 100644 --- 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'), + 'displayTime' => phabricator_time($hour->format('U'), $viewer), ); } diff --git a/webroot/rsrc/js/application/calendar/behavior-day-view.js b/webroot/rsrc/js/application/calendar/behavior-day-view.js index 5be51ce99c..651698b026 100644 --- a/webroot/rsrc/js/application/calendar/behavior-day-view.js +++ b/webroot/rsrc/js/application/calendar/behavior-day-view.js @@ -169,13 +169,13 @@ JX.behavior('day-view', function(config) { var cell_time = JX.$N( 'td', {className: 'phui-calendar-day-hour'}, - hours[i]['hour_meridian']); + hours[i].displayTime); var cell_event = JX.$N( 'td', { meta: { - time: hours[i]['hour_meridian'] + time: hours[i].displayTime }, className: 'phui-calendar-day-events', sigil: 'phui-calendar-day-event-cell'