core: fix logs sorting

This commit is contained in:
Abdullah Atta
2023-11-25 14:42:14 +05:00
committed by Ammar Ahmed
parent dff1c7ed32
commit cbb0a511a8

View File

@@ -123,9 +123,9 @@ class DatabaseLogManager {
}
return Object.keys(logGroups)
.sort((a, b) => new Date(a).getTime() - new Date(b).getTime())
.sort((a, b) => b.localeCompare(a, undefined, { numeric: true }))
.map((key) => ({
key: new Date(key).toLocaleDateString(),
key,
logs: logGroups[key]?.sort((a, b) => a.timestamp - b.timestamp)
}));
}