Skip to content

Commit

Permalink
core: fix logs sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr authored and ammarahm-ed committed Nov 25, 2023
1 parent dff1c7e commit cbb0a51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}));
}
Expand Down

0 comments on commit cbb0a51

Please sign in to comment.