strip "station" suffix

This commit is contained in:
cjdenio committed 2026-07-14 22:04:30 -06:00
1 parent b9072340cb
commit 1c791fbd4d
1 file changed
+5 -2
+5 -2
View File
@@ -15,7 +15,6 @@ setInterval(displayLastUpdated, 1000)
const RouteType = { const RouteType = {
TRAM: 1, TRAM: 1,
SUBWAY: 2,
RAIL: 3, RAIL: 3,
BUS: 4, BUS: 4,
} }
@@ -175,7 +174,11 @@ function vehiclePopupContent(vehicle) {
} }
if (vehicle.nearest_station) { if (vehicle.nearest_station) {
content += `<br />@ ${vehicle.nearest_station.name}` let station = vehicle.nearest_station.name
if (station.toLowerCase().endsWith("station")) {
station = station.replace(/ station$/i, "")
}
content += `<br />@ ${station}`
} }
content += `<br /><br /><small>vehicle #: ${vehicle.id} &middot; trip ID: ${vehicle.trip_id}</small>` content += `<br /><br /><small>vehicle #: ${vehicle.id} &middot; trip ID: ${vehicle.trip_id}</small>`