-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Account for DST and multi-day trips in departure boards #7250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-2.x
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #7250 +/- ##
=============================================
- Coverage 72.15% 72.12% -0.03%
Complexity 21089 21089
=============================================
Files 2297 2297
Lines 85218 85238 +20
Branches 8483 8489 +6
=============================================
- Hits 61487 61476 -11
- Misses 20753 20781 +28
- Partials 2978 2981 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
application/src/main/java/org/opentripplanner/transit/model/network/TripPattern.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| @ParameterizedTest | ||
| @CsvSource( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice usage of CsvSource.
utils/src/main/java/org/opentripplanner/utils/time/ServiceDateUtils.java
Outdated
Show resolved
Hide resolved
utils/src/main/java/org/opentripplanner/utils/time/ServiceDateUtils.java
Outdated
Show resolved
Hide resolved
utils/src/main/java/org/opentripplanner/utils/time/ServiceDateUtils.java
Outdated
Show resolved
Hide resolved
utils/src/test/java/org/opentripplanner/utils/time/ServiceDateUtilsTest.java
Outdated
Show resolved
Hide resolved
leonardehrenfried
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an elegant solution this problem and ready to be merged, IMO, but please consider my typo fixes.
Co-authored-by: Leonard Ehrenfried <[email protected]>
| /// - 29. March 2026 02:00 -> 03:00 First summer day start at 23:00, 1h overlap | ||
| /// - 25. October 2026 03:00 -> 02:00 Fist winter day start at 01:00, 1h gap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// - 29. March 2026 02:00 -> 03:00 First summer day start at 23:00, 1h overlap | |
| /// - 25. October 2026 03:00 -> 02:00 Fist winter day start at 01:00, 1h gap | |
| /// - 29. March 2026 02:00 -> 03:00 First summer service-day start at 23:00, 1h overlap | |
| /// - 25. October 2026 03:00 -> 02:00 Fist winter service-day start at 01:00, 1h gap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also fist -> first
leonardehrenfried
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one spelling mistake (fist -> first) but you can fix that on dev-2.x if you wish.
|
|
||
| // Adjust for overlapping service-days. This happens when we go from winter-time to summer time. | ||
| if (t1.getHour() == 23 && t1.plusHours(12).getHour() == 12) { | ||
| ld1 = ld1.plusDays(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you decrease ld0 in a corresponding way if any of the days from ld0 - 1 until t0 - 1 are 23 hour days?
Summary
When listing departures, some of the departures having a service date prior to the requested date is missing in the departure board listing.
The fix also account for DST. I have
Issue
Fixes #7249
Unit tests
✅ New unit tests are added to the complicated date calculation logic and to some of the business features methods.
Documentation
✅ Java doc is updated
Changelog
✅ This is relevant for the change log.
Bumping the serialization version id
✅ Bumping is necessary since the
TripPatternchanged.