From 199ca58ad852135efe26dfbfd0c427754b334293 Mon Sep 17 00:00:00 2001 From: Bennet Gallein Date: Sun, 25 May 2025 20:06:33 +0200 Subject: [PATCH] fix: add sorting by date --- pages/incidents.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/incidents.tsx b/pages/incidents.tsx index 977967c..9feb9c8 100644 --- a/pages/incidents.tsx +++ b/pages/incidents.tsx @@ -40,6 +40,7 @@ function filterIncidentsByMonth( ...e, monitors: (e.monitors || []).map((e) => workerConfig.monitors.find((mon) => mon.id === e)!), })) + .sort((a, b) => (new Date(a.start) > new Date(b.start) ? 1 : -1)) } function getPrevNextMonth(monthStr: string) {