mirror of
https://github.com/cjdenio/uta-trax-api.git
synced 2026-10-03 16:06:19 +00:00
strip "station" suffix
This commit is contained in:
1 file changed
+5
-2
+5
-2
@@ -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} · trip ID: ${vehicle.trip_id}</small>`
|
content += `<br /><br /><small>vehicle #: ${vehicle.id} · trip ID: ${vehicle.trip_id}</small>`
|
||||||
|
|||||||
Reference in new issue
Block a user