From 6a3806fe9d03abdfa1eb30fc62c7388a6922b60f Mon Sep 17 00:00:00 2001
From: Elias Nahum <nahumhbl@gmail.com>
Date: Wed, 3 Feb 2016 00:46:56 -0300
Subject: PLT-7: Refactoring frontend (chunk 11) - channel view - Added
 translations for previous commits - Fix bug on signup_team email body

---
 web/react/components/time_since.jsx | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

(limited to 'web/react/components/time_since.jsx')

diff --git a/web/react/components/time_since.jsx b/web/react/components/time_since.jsx
index 0b549b1e6..ba8dbffcc 100644
--- a/web/react/components/time_since.jsx
+++ b/web/react/components/time_since.jsx
@@ -2,7 +2,8 @@
 // See License.txt for license information.
 
 import Constants from '../utils/constants.jsx';
-import * as Utils from '../utils/utils.jsx';
+
+import {FormattedRelative, FormattedDate} from 'mm-intl';
 
 var Tooltip = ReactBootstrap.Tooltip;
 var OverlayTrigger = ReactBootstrap.OverlayTrigger;
@@ -20,20 +21,25 @@ export default class TimeSince extends React.Component {
         clearInterval(this.intervalId);
     }
     render() {
-        const displayDate = Utils.displayDate(this.props.eventTime);
-        const displayTime = Utils.displayTime(this.props.eventTime);
-
         if (this.props.sameUser) {
             return (
                 <time className='post__time'>
-                    {Utils.displayTime(this.props.eventTime)}
+                    <FormattedRelative value={this.props.eventTime} />
                 </time>
             );
         }
 
         const tooltip = (
             <Tooltip id={'time-since-tooltip-' + this.props.eventTime}>
-                {displayDate + ' at ' + displayTime}
+                <FormattedDate
+                    value={this.props.eventTime}
+                    month='long'
+                    day='numeric'
+                    year='numeric'
+                    hour12={true}
+                    hour='numeric'
+                    minute='2-digit'
+                />
             </Tooltip>
         );
 
@@ -44,7 +50,7 @@ export default class TimeSince extends React.Component {
                 overlay={tooltip}
             >
                 <time className='post__time'>
-                    {Utils.displayDateTime(this.props.eventTime)}
+                    <FormattedRelative value={this.props.eventTime} />
                 </time>
             </OverlayTrigger>
         );
-- 
cgit v1.2.3-1-g7c22

