Fix date-only range end dropping the final day - #296
Open
LuShadowX wants to merge 1 commit into
Open
Conversation
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.
When a search time range has a stop date with no time, the compiled
DateRangeend lands at midnight (00:00:00). ButDateRange.endis inclusive, so a query like "Jan 1 to Jan 5" producesend = 2023-01-05 00:00:00, and anything happening on Jan 5 after midnight falls outside the range — the whole final day is effectively dropped.The TypeScript original uses two helpers:
toStartDate(midnight for a date-only value) for the start, andtoStopDate(end-of-day,23:59:59.999) for the stop. The Python port used the start-of-day conversion for both, so the end-of-day behavior was lost.This adds a
stop_datetime_from_date_timehelper mirroringtoStopDate: a date-only stop now covers the whole day (23:59:59.999999), while an explicit time is still honored as-is. Added tests for both cases; the full offline test suite passes.