-
Creation Data和Last Update Date显示格式如:POSTED IN 2 HOURS UPDATED AN HOUR AGO。我希望修改为MM-DD-YYYY格式。 {/* Creation Date */}
{page.date && <span class="level-item" dangerouslySetInnerHTML={{
__html: `<i class="far fa-calendar-alt"></i> ${_p('article.created_at', `<time dateTime="${date_xml(page.date)}" title="${new Date(page.date).toLocaleString()}">${moment(page.date).format('MM-DD-YYYY')}</time>`)}`,
}}></span>}
##{/* Last Update Date */}
{shouldShowUpdated && <span class="level-item" dangerouslySetInnerHTML={{
__html: `<i class="far fa-calendar-check"></i> ${_p('article.updated_at', `<time dateTime="${date_xml(page.updated)}" title="${new Date(page.updated).toLocaleString()}">${moment(page.updated).format('MM-DD-YYYY')}</time>`)}`,
}}></span>} |
Beta Was this translation helpful? Give feedback.
Answered by
ppoffice
Jun 24, 2024
Replies: 1 comment 2 replies
-
Try this: {/* Creation Date */}
{page.date && <span class="level-item" dangerouslySetInnerHTML={{
__html: _p('article.created_at', `<time dateTime="${date_xml(page.date)}" title="${new Date(page.date).toLocaleString()}">${date(page.date, 'MM-DD-YYYY')}</time>`)
}}></span>}
{/* Last Update Date */}
{shouldShowUpdated && <span class="level-item" dangerouslySetInnerHTML={{
__html: _p('article.updated_at', `<time dateTime="${date_xml(page.updated)}" title="${new Date(page.updated).toLocaleString()}">${date(page.updated, 'MM-DD-YYYY')}</time>`)
}}></span>} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please ignore above answer. This is the right place to change date format:
hexo-theme-icarus/source/js/main.js