From f79f49b0f65f09cd08a8cd32b4079f344e649267 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sun, 29 Jun 2025 20:30:39 +0200 Subject: [PATCH] Fix schedule breaking on 2001-09-09 01:46:40Z Array.sort() sorts by UTF-16 code points even when the items in the array are numbers. Fix the schedule breaking when events cross different powers of 10 in Unix time which caused the junctions to no longer be sorted by the numeric value of their Unix time. --- components/Timetable.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Timetable.vue b/components/Timetable.vue index 78faac4..9ab9412 100644 --- a/components/Timetable.vue +++ b/components/Timetable.vue @@ -226,7 +226,7 @@ function junctionsFromEdges(edges: Iterable) { junctions.set(ts, { ts, edges: [edge] }); } } - const keys = [...junctions.keys()].sort(); + const keys = [...junctions.keys()].sort((a, b) => a - b); return keys.map(key => junctions.get(key)!); }