mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-09 07:26:47 +00:00
hotfix: sort by date
This commit is contained in:
@@ -45,9 +45,7 @@ export async function getAllPosts({ notionPageData, from, pageType }) {
|
||||
// Sort by date
|
||||
if (BLOG.POSTS_SORT_BY === 'date') {
|
||||
posts.sort((a, b) => {
|
||||
const dateA = new Date(a?.publishTime || a.createdTime)
|
||||
const dateB = new Date(b?.publishTime || b.createdTime)
|
||||
return dateB - dateA
|
||||
return b?.sortDate - a?.sortDate
|
||||
})
|
||||
}
|
||||
return posts
|
||||
|
||||
Reference in New Issue
Block a user