aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sql
diff options
context:
space:
mode:
authorTeddy Wing2017-05-30 15:14:45 +0200
committerTeddy Wing2017-05-31 17:57:36 +0200
commit43c14bc8c916d00a9c478f1e78d5860977c56bbe (patch)
tree7d65e70711c10bfc75303bb963a130f7b2cb5d9f /lib/sql
parentc6d622d662d7f787787d8ee3d89f5d900dd8ca59 (diff)
downloadchouette-core-43c14bc8c916d00a9c478f1e78d5860977c56bbe.tar.bz2
VehicleJourneyAtStopsDayOffset: Calculate day offsets
Add a rough implementation that determines the day offsets of a sequence of VehicleJourneyAtStops. It currently passes the first (and only test) associated with it. My first go at it assumed that the dates meant something, but really they're just there for decoration. All the dates will be on '2000-01-01' regardless of their day offset. This is because they need to be stored as dates, so the application has standardised on a single placeholder date. That go didn't work because the after-midnight times were still on '2000-01-01'. The new version bases the day offset on the times. It does this by checking whether the current time is earlier in the day than a previous time. If it is, we assume that the day has changed. This works when the gap between times is never 24 hours or more. It will not work if, for example, we have a "current day" time at 10:00 and a "next day" time at 10:00. We have no way to infer that they're on different days. This implementation appears to work, at least for the case the test is checking, but I don't like it because it doesn't read well. Hoping to change it in addition to adding my other test cases. Refs #3596
Diffstat (limited to 'lib/sql')
0 files changed, 0 insertions, 0 deletions