#5108 Add datetime attribute to <time> elements (#5199)

* #5108 Add datetime attribute to <time> elements

* fix eslint errors
Этот коммит содержится в:
Björn Roland
2017-01-27 14:06:51 +01:00
коммит произвёл Joram Wilander
родитель d72547433a
Коммит cfbace70ca
3 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@@ -27,7 +27,10 @@ export default class PostTime extends React.Component {
render() {
return (
<time className='post__time'>
<time
className='post__time'
dateTime={getDateForUnixTicks(this.props.eventTime).toISOString()}
>
{getDateForUnixTicks(this.props.eventTime).toLocaleString('en', {hour: '2-digit', minute: '2-digit', hour12: !this.props.useMilitaryTime})}
</time>
);

Просмотреть файл

@@ -478,7 +478,10 @@ export default class RhsComment extends React.Component {
</li>
{botIndicator}
<li className='col'>
<time className='post__time'>
<time
className='post__time'
dateTime={Utils.getDateForUnixTicks(post.create_at).toISOString()}
>
{Utils.getDateForUnixTicks(post.create_at).toLocaleString('en', timeOptions)}
</time>
{flagTrigger}

Просмотреть файл

@@ -417,7 +417,10 @@ export default class RhsRootPost extends React.Component {
<li className='col__name'>{userProfile}</li>
{botIndicator}
<li className='col'>
<time className='post__time'>
<time
className='post__time'
dateTime={Utils.getDateForUnixTicks(post.create_at).toISOString()}
>
{Utils.getDateForUnixTicks(post.create_at).toLocaleString('en', timeOptions)}
</time>
<OverlayTrigger