Commits

Marco Yuen committed 7169dd5

Change to display both directions, and more times.

Comments (0)

Files changed (1)

src/nextrain/controller.clj

 (:import (java.util Calendar)
          (java.text SimpleDateFormat)))
 
-; 30 minutes in millis
-(defonce time-offset (* 30 60 1000))
+; 60 minutes in millis
+(defonce time-offset (* 60 60 1000))
 (defonce calendar-date-format (SimpleDateFormat. "yyyyMMdd"))
 (defonce train-time-format    (SimpleDateFormat. "HH:mm:ss"))
 (defonce stops-cache (atom []))
         date (.format calendar-date-format (.getTime client-time))
         stop-id (:stop_id params)]
     (select stop_times
-      (fields :trip_id :departure_time :trips.trip_headsign :trips.route_id)
+      (fields :trip_id :departure_time :trips.trip_headsign :trips.route_id
+              :trips.direction_id)
       (join trips (= :stop_times.trip_id :trips.trip_id))
       (where (and {:stop_id stop-id}
                   {:departure_time [>= time]}
                   {:departure_time [<  future]}
-                  {:trips.direction_id 1} ; outbound
+                  ;; {:trips.direction_id 1} ; outbound
                   {date [in (subselect calendar_dates
                                        (fields :date)
                                        (where {:service_id :trips.service_id}))]}