summaryrefslogtreecommitdiffstats
path: root/web/react/components/time_since.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-02-03 14:32:01 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2016-02-03 14:32:01 -0500
commit2b4af8d8c73ba5b9b683b65b1df4d4e3f24edb81 (patch)
tree916555d3a3f53ce9c41873949706b3e723465937 /web/react/components/time_since.jsx
parentacac4ab989ac5b0af87aa53a1a1d0c9356dcafc9 (diff)
parentac184720facfaf43f1e48448375d125da19ddefd (diff)
downloadchat-2b4af8d8c73ba5b9b683b65b1df4d4e3f24edb81.tar.gz
chat-2b4af8d8c73ba5b9b683b65b1df4d4e3f24edb81.tar.bz2
chat-2b4af8d8c73ba5b9b683b65b1df4d4e3f24edb81.zip
Merge pull request #2060 from ZBoxApp/PLT-7-channel
PLT-7: Refactoring frontend (chunk 11)
Diffstat (limited to 'web/react/components/time_since.jsx')
-rw-r--r--web/react/components/time_since.jsx20
1 files changed, 13 insertions, 7 deletions
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>
);