* one-way tickets. */
const date = new Date();
- /* Add an hour and a half. We use the low-level get/setTime to
- * change the number of milliseconds since the epoch that this
- * date represents. Obviously correct, and avoids all suspicious
- * corner cases (well, for a few more decades). */
- date.setTime(date.getTime() + (90*60*1000));
+ /* BaltimoreLink and MARC Train are valid for an hour and a half */
+ var minutes = 90;
+ let params = new URLSearchParams(document.location.search);
+ if (params.get("servicename") == "Commuter Bus") {
+ /* But commuter bus tickets are only valid for ten minutes */
+ minutes = 10;
+ }
+
+ /* We use the low-level get/setTime to change the number of
+ * milliseconds since the epoch that this date represents
+ * Obviously correct, and avoids all suspicious corner cases
+ * for a few more decades. */
+ date.setTime(date.getTime() + (minutes*60*1000));
tt = document.getElementById("tickettime");
tt.textContent = date.toLocaleTimeString();