From cbb0a511a8a769c0c565bfd083de9f27dd411c20 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Sat, 25 Nov 2023 14:42:14 +0500 Subject: [PATCH] core: fix logs sorting --- packages/core/src/logger.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/logger.js b/packages/core/src/logger.js index c5ffb22530..4e62d3097b 100644 --- a/packages/core/src/logger.js +++ b/packages/core/src/logger.js @@ -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) })); }