fix: sort bookmarks by date descending
This commit is contained in:
parent
a88af69ffd
commit
5553270e67
1 changed files with 2 additions and 1 deletions
|
|
@ -13,7 +13,8 @@ interface Bookmark {
|
||||||
const posts = await getCollection('posts');
|
const posts = await getCollection('posts');
|
||||||
const sorted = posts.sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
|
const sorted = posts.sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
|
||||||
|
|
||||||
const bookmarks = yaml.load(bookmarksRaw) as Bookmark[];
|
const bookmarks = (yaml.load(bookmarksRaw) as Bookmark[])
|
||||||
|
.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
|
||||||
|
|
||||||
function formatDate(date: Date): string {
|
function formatDate(date: Date): string {
|
||||||
const d = String(date.getDate()).padStart(2, '0');
|
const d = String(date.getDate()).padStart(2, '0');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue