From ab5161bbc8a78340124277f7764062b1b6c30666 Mon Sep 17 00:00:00 2001 From: curben Date: Tue, 4 Jun 2019 13:35:48 +0930 Subject: [PATCH] style: parse date only, ignore time --- themes/typing/layout/_partial/post/date.ejs | 2 +- themes/typing/layout/_partial/post/updated-date.ejs | 2 +- themes/typing/scripts/openGraph.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/themes/typing/layout/_partial/post/date.ejs b/themes/typing/layout/_partial/post/date.ejs index 9e0a38e..825dfc8 100644 --- a/themes/typing/layout/_partial/post/date.ejs +++ b/themes/typing/layout/_partial/post/date.ejs @@ -1,4 +1,4 @@ <%/* Date format is specified to skip timezone conversion */%> - + diff --git a/themes/typing/layout/_partial/post/updated-date.ejs b/themes/typing/layout/_partial/post/updated-date.ejs index 20a1f4f..11caaad 100644 --- a/themes/typing/layout/_partial/post/updated-date.ejs +++ b/themes/typing/layout/_partial/post/updated-date.ejs @@ -1,5 +1,5 @@ <%/* User-specified updated date */%> <%/* default post.updated is (almost) always is the time 'hexo generate' is executed */%> - + diff --git a/themes/typing/scripts/openGraph.js b/themes/typing/scripts/openGraph.js index 30b789a..abf86d6 100644 --- a/themes/typing/scripts/openGraph.js +++ b/themes/typing/scripts/openGraph.js @@ -121,14 +121,14 @@ function openGraphHelper (options = {}) { if (published) { if ((moment.isMoment(published) || moment.isDate(published)) && !isNaN(published.valueOf())) { // Skip timezone conversion - result += og('article:published_time', moment(published).format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]')) + result += og('article:published_time', moment(published).format('YYYY-MM-DD[T00:00:00.000Z]')) } } if (updated) { if ((moment.isMoment(updated) || moment.isDate(updated)) && !isNaN(updated.valueOf())) { - result += og('article:modified_time', moment(updated).format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]')) - result += og('og:updated_time', moment(updated).format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]')) + result += og('article:modified_time', moment(updated).format('YYYY-MM-DD[T00:00:00.000Z]')) + result += og('og:updated_time', moment(updated).format('YYYY-MM-DD[T00:00:00.000Z]')) } }