fix: date format

This commit is contained in:
Cory Dransfeldt 2024-04-06 09:31:01 -07:00
parent bca668ef72
commit 3075a0499e
No known key found for this signature in database
20 changed files with 53 additions and 118 deletions

View file

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