From 85adcaba288cb34db8e1834e4b98a65726731174 Mon Sep 17 00:00:00 2001 From: mandalore Date: Tue, 15 Sep 2026 15:25:04 -0500 Subject: [PATCH] Show "Local" instead of mileage for events within 30 miles of St. Louis Co-Authored-By: Claude Sonnet 5 --- sites/events/src/main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sites/events/src/main.js b/sites/events/src/main.js index fb806b5..babdc2c 100644 --- a/sites/events/src/main.js +++ b/sites/events/src/main.js @@ -201,6 +201,13 @@ function distanceFromStLouis(ev) { return milesBetween(lat, lon, ST_LOUIS.lat, ST_LOUIS.lon); } +const LOCAL_RADIUS_MILES = 30; + +function distanceLabel(distance) { + if (distance === null) return ""; + return distance < LOCAL_RADIUS_MILES ? "Local" : `${Math.round(distance)} mi from STL`; +} + // BCP's only reliable format signal is the teamEvent flag. There's no // dedicated "team size" field — the closest candidate (totalPlayers / // totalTeamPlayers) reflects live registration progress, not the event's @@ -296,7 +303,7 @@ function eventCard(ev, circuits) {
${esc(ev.name)}
-
${esc(locationOf(ev))}${distance !== null ? ` · ${Math.round(distance)} mi from STL` : ""}
+
${esc(locationOf(ev))}${distance !== null ? ` · ${distanceLabel(distance)}` : ""}
${format}${scopeBadge}${circuitBadges}${system}${capacity}