日期格式化
This commit is contained in:
parent
0b0053c07e
commit
343fa3f9d9
@ -18,7 +18,6 @@ timezone:
|
|||||||
# URL
|
# URL
|
||||||
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
|
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
|
||||||
url: https://www.colorfulsweet.site
|
url: https://www.colorfulsweet.site
|
||||||
# url: http://localhost:6603
|
|
||||||
root: /
|
root: /
|
||||||
permalink: :title/
|
permalink: :title/
|
||||||
permalink_defaults:
|
permalink_defaults:
|
||||||
@ -83,9 +82,9 @@ theme: yilia
|
|||||||
#----------------------------
|
#----------------------------
|
||||||
# 搜索
|
# 搜索
|
||||||
#----------------------------
|
#----------------------------
|
||||||
search:
|
# search:
|
||||||
path: search.xml
|
# path: search.xml
|
||||||
field: all
|
# field: all
|
||||||
|
|
||||||
# Deployment
|
# Deployment
|
||||||
## Docs: https://hexo.io/docs/deployment.html
|
## Docs: https://hexo.io/docs/deployment.html
|
||||||
@ -97,6 +96,7 @@ deploy:
|
|||||||
jsonContent:
|
jsonContent:
|
||||||
meta: false
|
meta: false
|
||||||
pages: false
|
pages: false
|
||||||
|
dateFormat: YYYY-MM-DD
|
||||||
posts:
|
posts:
|
||||||
title: true
|
title: true
|
||||||
date: true
|
date: true
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
<%- js('js/mobile.cfb38e2874478d984279.js') %> <%- js('js/slider.5ca5d3094d7d23f182cf.js') %> <%- js('js/main.34802c21ea4824f2ae00.js') %>
|
<%- js('js/mobile.cfb38e2874478d984279.js') %> <%- js('js/slider.f9a33fdc5a046f675ae0.js') %> <%- js('js/main.34802c21ea4824f2ae00.js') %>
|
||||||
@ -85,19 +85,19 @@
|
|||||||
</p>
|
</p>
|
||||||
<li class="search-li" v-for="item in items" v-show="!item.isHide">
|
<li class="search-li" v-for="item in items" v-show="!item.isHide">
|
||||||
<a :href="item.path|urlformat" class="search-title"><i class="icon-quo-left icon"></i>
|
<a :href="item.path|urlformat" class="search-title"><i class="icon-quo-left icon"></i>
|
||||||
<span>{{item.title}}</span>
|
<span v-text="item.title"></span>
|
||||||
</a>
|
</a>
|
||||||
<p class="search-time">
|
<p class="search-time">
|
||||||
<i class="icon-calendar icon"></i>
|
<i class="icon-calendar icon"></i>
|
||||||
<span >{{item.date|dateformat}}</span>
|
<span v-text="item.date"></span>
|
||||||
</p>
|
</p>
|
||||||
<p class="search-category" v-if="item.categories.length">
|
<p class="search-category" v-if="item.categories.length">
|
||||||
<i class="icon-book icon" ></i>
|
<i class="icon-book icon" ></i>
|
||||||
<span v-for="category in item.categories" @click="chose(category.name, '$')" >{{category.name}}</span>
|
<span v-for="category in item.categories" @click="chose(category.name, '$')" v-text="category.name"></span>
|
||||||
</p>
|
</p>
|
||||||
<p class="search-tag" v-if="item.tags.length">
|
<p class="search-tag" v-if="item.tags.length">
|
||||||
<i class="icon-price-tags icon" ></i>
|
<i class="icon-price-tags icon" ></i>
|
||||||
<span v-for="tag in item.tags" @click="chose(tag.name, '#')" >{{tag.name}}</span>
|
<span v-for="tag in item.tags" @click="chose(tag.name, '#')" v-text="tag.name"></span>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@ -8,18 +8,13 @@ import Vue from './vue.min'
|
|||||||
|
|
||||||
const isMobile = (Browser.versions.mobile && window.screen.width < 800)
|
const isMobile = (Browser.versions.mobile && window.screen.width < 800)
|
||||||
|
|
||||||
function fixzero(str) {
|
|
||||||
str = str + ''
|
|
||||||
return str.length === 1 ? '0' + str : str
|
|
||||||
}
|
|
||||||
|
|
||||||
function setScrollZero() {
|
function setScrollZero() {
|
||||||
let $sct = document.querySelectorAll('.tools-section')
|
let $sct = document.querySelectorAll('.tools-section')
|
||||||
Array.prototype.forEach.call($sct, (em) => {
|
Array.prototype.forEach.call($sct, (em) => {
|
||||||
em.scrollTop = 0
|
em.scrollTop = 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
let vm = new Vue({
|
new Vue({
|
||||||
el: '#container',
|
el: '#container',
|
||||||
data: {
|
data: {
|
||||||
isCtnShow: false,
|
isCtnShow: false,
|
||||||
@ -64,14 +59,7 @@ let vm = new Vue({
|
|||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
urlformat: (str) => {
|
urlformat: (str) => {
|
||||||
if (window.yiliaConfig && window.yiliaConfig.root) {
|
return (window.yiliaConfig && window.yiliaConfig.root) ? window.yiliaConfig.root + str : '/' + str;
|
||||||
return window.yiliaConfig.root + str
|
|
||||||
}
|
|
||||||
return '/' + str
|
|
||||||
},
|
|
||||||
dateformat: (str) => {
|
|
||||||
let d = new Date(str)
|
|
||||||
return d.getFullYear() + '-' + fixzero((d.getMonth() + 1)) + '-' + fixzero(d.getDate())
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user