fix journal detail sort

This commit is contained in:
Timi
2025-12-10 14:08:24 +08:00
parent 3305e4a508
commit b4f25929df

View File

@ -143,7 +143,7 @@ Page({
}) || []; }) || [];
// 转换为 JournalInfo 格式 // 转换为 JournalInfo 格式
const journals: JournalInfo[] = list.map((journal: any) => { const journals: JournalInfo[] = list.sort((a, b) => a.createdAt! - b.createdAt!).map((journal: any) => {
const date = new Date(journal.createdAt); const date = new Date(journal.createdAt);
return { return {
id: journal.id, id: journal.id,
@ -165,9 +165,6 @@ Page({
}; };
}); });
// 按 id 倒序排序
journals.sort((a, b) => b.id - a.id);
this.setData({ this.setData({
selectedDate: { selectedDate: {
displayDate, displayDate,