style(home): rename post update date
This commit is contained in:
parent
6e366f0496
commit
a02282db69
|
@ -1,12 +1,9 @@
|
|||
<%
|
||||
const target_date = post.date !== post.updated ? post.updated : post.date
|
||||
%>
|
||||
<div class="home-article-meta-info-container">
|
||||
<div class="home-article-meta-info">
|
||||
<span>
|
||||
<i class="fas fa-history"></i>
|
||||
<span class="home-article-date" data-date="<%= target_date %>">
|
||||
<%= date(target_date, 'YYYY-MM-DD') %>
|
||||
<span class="home-article-date" data-updated="<%= post.updated %>">
|
||||
<%= date(post.updated, 'YYYY-MM-DD') %>
|
||||
</span>
|
||||
</span>
|
||||
<% if (post.categories.length && theme.home_article.category.enable === true) { %>
|
||||
|
|
|
@ -295,7 +295,7 @@ KEEP.initUtils = () => {
|
|||
post &&
|
||||
post.forEach((v) => {
|
||||
const nowDate = Date.now()
|
||||
const postDate = new Date(v.dataset.date.split(' GMT')[0]).getTime()
|
||||
const postDate = new Date(v.dataset.updated.split(' GMT')[0]).getTime()
|
||||
v.innerHTML = this.getHowLongAgo(Math.floor((nowDate - postDate) / 1000))
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue