style(home): rename post update date

This commit is contained in:
XPoet 2023-01-13 10:19:04 +08:00
parent 6e366f0496
commit a02282db69
2 changed files with 3 additions and 6 deletions

View File

@ -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>&nbsp; <i class="fas fa-history"></i>&nbsp;
<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) { %>

View File

@ -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))
}) })
}, },