Repository navigation
fix(schedule): move a past-midnight close stamped with the opening date to the next day - #697
Merged
Merged
Conversation
…te to the next day Some sources write a close after midnight with the date the park opened, so closingTime <= openingTime: Gardaland's 31 Oct 2026 late opening (10:00 to "2026-10-31T00:00"), Busch Gardens Tampa and SeaWorld San Diego event nights (19:00 to "00:00"/"01:00" the same date), Walibi Rhone-Alpes on 24 Oct. Read literally each is an empty window, so anything deciding "open now" from the hours sees the park closed through the whole open day. getSchedules() now moves such a close forward one calendar day for every park, recomputing the offset in the park's timezone. A close a full day or more before the open is left alone. Over every park's published Oct-Nov 2026 schedule (8985 entries) exactly those 30 days change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Some sources write a close that falls after midnight using the date the park opened. The result is a schedule day whose
closingTimeis at or before itsopeningTime:2026-10-31T00:00:00+01:0000:00/01:00, same date00:00, same date01:00, same dateRead literally, each of these is an empty window. A consumer that works out "open now" from the hours sees the park as closed for the whole open day.
Fix
rollPastMidnightClose()insrc/datetime.ts. It moves a close that sits less than 24 h before its open to the same wall-clock time on the next calendar day.Destination.getSchedules()applies it to every entry with times, for every park. That puts the fix in one place instead of in each framework's builder, so a new source with the same shape is covered too. The entry'sdateis unchanged.Before/after
I applied the new pass to every park's currently published Oct-Nov 2026 schedule: 8,985 entries, of which exactly the 30 days in the table above change. No other entry moves.
Tests
src/__tests__/pastMidnightClose.test.tscovers:getSchedules()rolling one entry while leaving the others as built.The full suite passes: 188 files, 4,172 tests.