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-container">
|
||||||
<div class="home-article-meta-info">
|
<div class="home-article-meta-info">
|
||||||
<span>
|
<span>
|
||||||
<i class="fas fa-history"></i>
|
<i class="fas fa-history"></i>
|
||||||
<span class="home-article-date" data-date="<%= target_date %>">
|
<span class="home-article-date" data-updated="<%= post.updated %>">
|
||||||
<%= date(target_date, 'YYYY-MM-DD') %>
|
<%= date(post.updated, 'YYYY-MM-DD') %>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<% if (post.categories.length && theme.home_article.category.enable === true) { %>
|
<% if (post.categories.length && theme.home_article.category.enable === true) { %>
|
||||||
|
|
|
@ -295,7 +295,7 @@ KEEP.initUtils = () => {
|
||||||
post &&
|
post &&
|
||||||
post.forEach((v) => {
|
post.forEach((v) => {
|
||||||
const nowDate = Date.now()
|
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))
|
v.innerHTML = this.getHowLongAgo(Math.floor((nowDate - postDate) / 1000))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue