PLT-443 Fix timestamps UI in center channel and RHS (#4463)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
7117fc0562
Коммит
20254073cb
@@ -6,7 +6,7 @@ import React from 'react';
|
|||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
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 {
|
export default class PostTime extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -28,12 +28,7 @@ export default class PostTime extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<time className='post__time'>
|
<time className='post__time'>
|
||||||
<FormattedTime
|
{getDateForUnixTicks(this.props.eventTime).toLocaleString('en', {hour: '2-digit', minute: '2-digit', hour12: !this.props.useMilitaryTime})}
|
||||||
value={this.props.eventTime}
|
|
||||||
hour='2-digit'
|
|
||||||
minute='2-digit'
|
|
||||||
hour12={!this.props.useMilitaryTime}
|
|
||||||
/>
|
|
||||||
</time>
|
</time>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import * as PostUtils from 'utils/post_utils.jsx';
|
|||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
|
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
|
||||||
|
|
||||||
import {FormattedMessage, FormattedDate} from 'react-intl';
|
import {FormattedMessage} from 'react-intl';
|
||||||
|
|
||||||
import loadingGif from 'images/load.gif';
|
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 (
|
return (
|
||||||
<div className={'post post--thread ' + currentUserCss + ' ' + compactClass}>
|
<div className={'post post--thread ' + currentUserCss + ' ' + compactClass}>
|
||||||
<div className='post__content'>
|
<div className='post__content'>
|
||||||
@@ -398,15 +407,7 @@ export default class RhsComment extends React.Component {
|
|||||||
{botIndicator}
|
{botIndicator}
|
||||||
<li className='col'>
|
<li className='col'>
|
||||||
<time className='post__time'>
|
<time className='post__time'>
|
||||||
<FormattedDate
|
{Utils.getDateForUnixTicks(post.create_at).toLocaleString('en', timeOptions)}
|
||||||
value={post.create_at}
|
|
||||||
day='numeric'
|
|
||||||
month='short'
|
|
||||||
year='numeric'
|
|
||||||
hour12={!this.props.useMilitaryTime}
|
|
||||||
hour='2-digit'
|
|
||||||
minute='2-digit'
|
|
||||||
/>
|
|
||||||
</time>
|
</time>
|
||||||
{flagTrigger}
|
{flagTrigger}
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import * as PostUtils from 'utils/post_utils.jsx';
|
|||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
|
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
|
||||||
|
|
||||||
import {FormattedMessage, FormattedDate} from 'react-intl';
|
import {FormattedMessage} from 'react-intl';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
@@ -357,6 +357,15 @@ export default class RhsRootPost extends React.Component {
|
|||||||
flagFunc = this.flagPost;
|
flagFunc = this.flagPost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const timeOptions = {
|
||||||
|
day: 'numeric',
|
||||||
|
month: 'short',
|
||||||
|
year: 'numeric',
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
hour12: !this.props.useMilitaryTime
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'post post--root post--thread ' + userCss + ' ' + systemMessageClass + ' ' + compactClass}>
|
<div className={'post post--root post--thread ' + userCss + ' ' + systemMessageClass + ' ' + compactClass}>
|
||||||
<div className='post-right-channel__name'>{channelName}</div>
|
<div className='post-right-channel__name'>{channelName}</div>
|
||||||
@@ -368,15 +377,7 @@ export default class RhsRootPost extends React.Component {
|
|||||||
{botIndicator}
|
{botIndicator}
|
||||||
<li className='col'>
|
<li className='col'>
|
||||||
<time className='post__time'>
|
<time className='post__time'>
|
||||||
<FormattedDate
|
{Utils.getDateForUnixTicks(post.create_at).toLocaleString('en', timeOptions)}
|
||||||
value={post.create_at}
|
|
||||||
day='numeric'
|
|
||||||
month='short'
|
|
||||||
year='numeric'
|
|
||||||
hour12={!this.props.useMilitaryTime}
|
|
||||||
hour='2-digit'
|
|
||||||
minute='2-digit'
|
|
||||||
/>
|
|
||||||
</time>
|
</time>
|
||||||
<OverlayTrigger
|
<OverlayTrigger
|
||||||
key={'rootpostflagtooltipkey' + flagVisible}
|
key={'rootpostflagtooltipkey' + flagVisible}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user