summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-11-04 18:20:13 -0300
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-04 17:20:13 -0400
commit20254073cb9976e783875f997a291829e6a0d78d (patch)
tree02987516a3f41a0116761e6a889ad3951d57cb29 /webapp
parent7117fc05620eef128dc351e3637dc4f61d463ef9 (diff)
downloadchat-20254073cb9976e783875f997a291829e6a0d78d.tar.gz
chat-20254073cb9976e783875f997a291829e6a0d78d.tar.bz2
chat-20254073cb9976e783875f997a291829e6a0d78d.zip
PLT-443 Fix timestamps UI in center channel and RHS (#4463)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/post_view/components/post_time.jsx9
-rw-r--r--webapp/components/rhs_comment.jsx21
-rw-r--r--webapp/components/rhs_root_post.jsx21
3 files changed, 24 insertions, 27 deletions
diff --git a/webapp/components/post_view/components/post_time.jsx b/webapp/components/post_view/components/post_time.jsx
index 369a429a9..c8e57f6a9 100644
--- a/webapp/components/post_view/components/post_time.jsx
+++ b/webapp/components/post_view/components/post_time.jsx
@@ -6,7 +6,7 @@ import React from 'react';
import Constants from 'utils/constants.jsx';
import PureRenderMixin from 'react-addons-pure-render-mixin';
-import {FormattedTime} from 'react-intl';
+import {getDateForUnixTicks} from 'utils/utils.jsx';
export default class PostTime extends React.Component {
constructor(props) {
@@ -28,12 +28,7 @@ export default class PostTime extends React.Component {
render() {
return (
<time className='post__time'>
- <FormattedTime
- value={this.props.eventTime}
- hour='2-digit'
- minute='2-digit'
- hour12={!this.props.useMilitaryTime}
- />
+ {getDateForUnixTicks(this.props.eventTime).toLocaleString('en', {hour: '2-digit', minute: '2-digit', hour12: !this.props.useMilitaryTime})}
</time>
);
}
diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx
index 85fe8abdf..c7b005845 100644
--- a/webapp/components/rhs_comment.jsx
+++ b/webapp/components/rhs_comment.jsx
@@ -19,7 +19,7 @@ import * as PostUtils from 'utils/post_utils.jsx';
import Constants from 'utils/constants.jsx';
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
-import {FormattedMessage, FormattedDate} from 'react-intl';
+import {FormattedMessage} from 'react-intl';
import loadingGif from 'images/load.gif';
@@ -386,6 +386,15 @@ export default class RhsComment extends React.Component {
);
}
+ const timeOptions = {
+ day: 'numeric',
+ month: 'short',
+ year: 'numeric',
+ hour: '2-digit',
+ minute: '2-digit',
+ hour12: !this.props.useMilitaryTime
+ };
+
return (
<div className={'post post--thread ' + currentUserCss + ' ' + compactClass}>
<div className='post__content'>
@@ -398,15 +407,7 @@ export default class RhsComment extends React.Component {
{botIndicator}
<li className='col'>
<time className='post__time'>
- <FormattedDate
- value={post.create_at}
- day='numeric'
- month='short'
- year='numeric'
- hour12={!this.props.useMilitaryTime}
- hour='2-digit'
- minute='2-digit'
- />
+ {Utils.getDateForUnixTicks(post.create_at).toLocaleString('en', timeOptions)}
</time>
{flagTrigger}
</li>
diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx
index a0edd716e..aa663bda7 100644
--- a/webapp/components/rhs_root_post.jsx
+++ b/webapp/components/rhs_root_post.jsx
@@ -20,7 +20,7 @@ import * as PostUtils from 'utils/post_utils.jsx';
import Constants from 'utils/constants.jsx';
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
-import {FormattedMessage, FormattedDate} from 'react-intl';
+import {FormattedMessage} from 'react-intl';
import React from 'react';
@@ -357,6 +357,15 @@ export default class RhsRootPost extends React.Component {
flagFunc = this.flagPost;
}
+ const timeOptions = {
+ day: 'numeric',
+ month: 'short',
+ year: 'numeric',
+ hour: '2-digit',
+ minute: '2-digit',
+ hour12: !this.props.useMilitaryTime
+ };
+
return (
<div className={'post post--root post--thread ' + userCss + ' ' + systemMessageClass + ' ' + compactClass}>
<div className='post-right-channel__name'>{channelName}</div>
@@ -368,15 +377,7 @@ export default class RhsRootPost extends React.Component {
{botIndicator}
<li className='col'>
<time className='post__time'>
- <FormattedDate
- value={post.create_at}
- day='numeric'
- month='short'
- year='numeric'
- hour12={!this.props.useMilitaryTime}
- hour='2-digit'
- minute='2-digit'
- />
+ {Utils.getDateForUnixTicks(post.create_at).toLocaleString('en', timeOptions)}
</time>
<OverlayTrigger
key={'rootpostflagtooltipkey' + flagVisible}