From ba77aefe02159325752cfa79210f5e4b5fcef77e Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Wed, 15 Jun 2016 08:13:17 -0400
Subject: PLT-3202 Re-render timestamps when display settings switch between
 12h and 24h (#3337)

* Made post timestamp switch from 12h to 24h without refreshing

* Made RHS post timestamps switch from 12h to 24h without refreshing
---
 webapp/components/rhs_root_post.jsx | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'webapp/components/rhs_root_post.jsx')

diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx
index ff6452035..b70b284d9 100644
--- a/webapp/components/rhs_root_post.jsx
+++ b/webapp/components/rhs_root_post.jsx
@@ -35,6 +35,11 @@ export default class RhsRootPost extends React.Component {
         if (nextProps.compactDisplay !== this.props.compactDisplay) {
             return true;
         }
+
+        if (nextProps.useMilitaryTime !== this.props.useMilitaryTime) {
+            return true;
+        }
+
         if (!Utils.areObjectsEqual(nextProps.post, this.props.post)) {
             return true;
         }
@@ -255,7 +260,7 @@ export default class RhsRootPost extends React.Component {
                                         day='numeric'
                                         month='long'
                                         year='numeric'
-                                        hour12={!Utils.isMilitaryTime()}
+                                        hour12={!this.props.useMilitaryTime}
                                         hour='2-digit'
                                         minute='2-digit'
                                     />
@@ -289,5 +294,6 @@ RhsRootPost.propTypes = {
     user: React.PropTypes.object.isRequired,
     currentUser: React.PropTypes.object.isRequired,
     commentCount: React.PropTypes.number,
-    compactDisplay: React.PropTypes.bool
+    compactDisplay: React.PropTypes.bool,
+    useMilitaryTime: React.PropTypes.bool.isRequired
 };
-- 
cgit v1.2.3-1-g7c22

