ibi-group / trimet-mod-otp

5 stars 5 forks source link

Stop Viewer: wrong day name and scheduled times after 12 a.m. #235

Closed fpurcell closed 5 years ago

fpurcell commented 5 years ago

The stop viewer is showing scheduled times with the wrong week day for arrivals once the clock turns past midnight. If I was to guess, the tracker is showing the weekday name for which the service is scheduled (in this case Wednesday), but not the proper weekday name on which the vehicle travels (Thursday morning at 12:51 a.m.).

Here's the arrival time for line 20 hitting this stop in ~45 minutes. The display for the RT arrival says scheduled, and it shows Wednesday. Although the arrival happens in 45 minutes on Thursday at 12:51am. Note that the 12:51am time is sourced from the 'Wednesday service' (e.g., the stop_time in gtfs would be 24:51 from a service key for the Wednesday), the display should show just the 12:51am scheduled arrival time if no real-time data is available, or show a 45 min countdown when coupled with gtfs-rt arrival information (i.e., in this case, the bus was running and one assumes there was gtfs-rt arrival data available in the graph). Screen Shot 2019-08-08 at 12 06 29 AM

Also wasn't limited to line 20. All other late nite arrivals were showing a scheduled time for Wednesday, ala line 15 for this stop: Screen Shot 2019-08-08 at 12 05 40 AM

Finally, wanted to show what happens to the display as the bus approaches... Screen Shot 2019-08-08 at 12 38 37 AM

...and passes a stop: Screen Shot 2019-08-08 at 12 42 03 AM

See also: #184 , #118 and #98

landonreed commented 5 years ago

Hi @fpurcell, thanks for the great screenshots!

I'm working on a fix locally and here's how it looks with my changes:

image

image

I've added a check for arrivals that happen after midnight, so I think all of these cases should be fixed now. Let me know if you think this image looks to have fixed the issue.