fix journal detail sort
This commit is contained in:
@ -143,7 +143,7 @@ Page({
|
||||
}) || [];
|
||||
|
||||
// 转换为 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);
|
||||
return {
|
||||
id: journal.id,
|
||||
@ -165,9 +165,6 @@ Page({
|
||||
};
|
||||
});
|
||||
|
||||
// 按 id 倒序排序
|
||||
journals.sort((a, b) => b.id - a.id);
|
||||
|
||||
this.setData({
|
||||
selectedDate: {
|
||||
displayDate,
|
||||
|
||||
Reference in New Issue
Block a user