summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorBjörn Roland <bjoernr-de@users.noreply.github.com>2017-02-08 17:38:59 +0100
committerJoram Wilander <jwawilander@gmail.com>2017-02-08 08:38:59 -0800
commit829f3cce9520fae81712a10bc2184315ad6ad107 (patch)
treea9615e59d02fe22c87c4aab56b1d3c23f6304446 /webapp
parent82779453631916bcd4d88f987b34cb6246239f6d (diff)
downloadchat-829f3cce9520fae81712a10bc2184315ad6ad107.tar.gz
chat-829f3cce9520fae81712a10bc2184315ad6ad107.tar.bz2
chat-829f3cce9520fae81712a10bc2184315ad6ad107.zip
#5108 Use <time> element for channel headers and search result headers (#5331)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/post_view/components/post_list.jsx18
-rw-r--r--webapp/components/search_results_item.jsx15
2 files changed, 19 insertions, 14 deletions
diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx
index 3584e9923..5ff95477b 100644
--- a/webapp/components/post_view/components/post_list.jsx
+++ b/webapp/components/post_view/components/post_list.jsx
@@ -354,7 +354,7 @@ export default class PostList extends React.Component {
/>
);
- const currentPostDay = Utils.getDateForUnixTicks(post.create_at);
+ const currentPostDay = new Date(Utils.getDateForUnixTicks(post.create_at).setUTCHours(0, 0, 0, 0));
if (currentPostDay.toDateString() !== previousPostDay.toDateString()) {
postCtls.push(
<div
@@ -363,13 +363,15 @@ export default class PostList extends React.Component {
>
<hr className='separator__hr'/>
<div className='separator__text'>
- <FormattedDate
- value={currentPostDay}
- weekday='short'
- month='short'
- day='2-digit'
- year='numeric'
- />
+ <time dateTime={currentPostDay.toISOString()}>
+ <FormattedDate
+ value={currentPostDay}
+ weekday='short'
+ month='short'
+ day='2-digit'
+ year='numeric'
+ />
+ </time>
</div>
</div>
);
diff --git a/webapp/components/search_results_item.jsx b/webapp/components/search_results_item.jsx
index be62653c0..f0096a324 100644
--- a/webapp/components/search_results_item.jsx
+++ b/webapp/components/search_results_item.jsx
@@ -241,17 +241,20 @@ export default class SearchResultsItem extends React.Component {
);
}
+ const postCreateDate = new Date(Utils.getDateForUnixTicks(post.create_at).setUTCHours(0, 0, 0, 0));
return (
<div className='search-item__container'>
<div className='date-separator'>
<hr className='separator__hr'/>
<div className='separator__text'>
- <FormattedDate
- value={post.create_at}
- day='numeric'
- month='long'
- year='numeric'
- />
+ <time dateTime={postCreateDate.toISOString()}>
+ <FormattedDate
+ value={postCreateDate}
+ day='numeric'
+ month='long'
+ year='numeric'
+ />
+ </time>
</div>
</div>
<div