fix: date format
This commit is contained in:
parent
bca668ef72
commit
3075a0499e
20 changed files with 53 additions and 118 deletions
|
@ -47,10 +47,10 @@ export default {
|
|||
getPopularPosts: (posts, analytics) => {
|
||||
return posts
|
||||
.filter((post) => {
|
||||
if (analytics.find((p) => p.pathname === post.url)) return true
|
||||
if (analytics.find((p) => p.url.includes(post.url))) return true
|
||||
})
|
||||
.sort((a, b) => {
|
||||
const visitors = (page) => analytics.filter((p) => p.pathname === page.url).pop().visitors
|
||||
const visitors = (page) => analytics.filter((p) => p.url.includes(page.url)).pop().value
|
||||
return visitors(b) - visitors(a)
|
||||
})
|
||||
},
|
||||
|
|
Reference in a new issue