mirror of
https://github.com/cjdenio/uta-trax-api.git
synced 2026-08-04 22:06:34 +00:00
strip "station" suffix
This commit is contained in:
+5
-2
@@ -15,7 +15,6 @@ setInterval(displayLastUpdated, 1000)
|
||||
|
||||
const RouteType = {
|
||||
TRAM: 1,
|
||||
SUBWAY: 2,
|
||||
RAIL: 3,
|
||||
BUS: 4,
|
||||
}
|
||||
@@ -175,7 +174,11 @@ function vehiclePopupContent(vehicle) {
|
||||
}
|
||||
|
||||
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} · trip ID: ${vehicle.trip_id}</small>`
|
||||
|
||||
Reference in New Issue
Block a user