From f54b6b971b228bb0f17cd799b4d6e13a059e31a6 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sat, 23 Aug 2025 06:43:05 -0600 Subject: [PATCH] Sort events by color if otherwise equal. --- src/components/EventOverlay.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/EventOverlay.vue b/src/components/EventOverlay.vue index 903c448..215f01d 100644 --- a/src/components/EventOverlay.vue +++ b/src/components/EventOverlay.vue @@ -61,6 +61,12 @@ const eventSpans = computed(() => { const spanB = b.endIdx - b.startIdx if (spanA !== spanB) return spanB - spanA if (a.startIdx !== b.startIdx) return a.startIdx - b.startIdx + // For one-day events that are otherwise equal, sort by color (0 first) + if (spanA === 0 && spanB === 0 && a.startIdx === b.startIdx) { + const colorA = a.colorId || 0 + const colorB = b.colorId || 0 + if (colorA !== colorB) return colorA - colorB + } return String(a.id).localeCompare(String(b.id)) }) // Assign non-overlapping rows