Repository navigation
fix(search): Improve date/time expression handling - #8988
Merged
Merged
Conversation
tkaemming
commented
Jul 9, 2018
Contributor
- Adds support for specifying inclusivity/exclusivity of date expressions.
- Fixes ISSUE-67 (incorrect handling of datetime values when used in a condition expression.)
tkaemming
commented
Jul 9, 2018
| return ( | ||
| None, | ||
| (timezone.now() - delta, True), | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
Making these both inclusive was sort of an arbitrary choice, I can change it if anyone has strong opinions otherwise.
| return ( | ||
| (value - timedelta(minutes=5), True), | ||
| (value + timedelta(minutes=6), False), | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
My assumption here is this interval is widened to increase the likelihood of showing results that happened "around that time"?
Contributor
There was a problem hiding this comment.
Yeah... this... this one hurts my head a bit.
| if value[:2] in ('>=', '=>'): | ||
| return (parse_datetime_value(value[2:])[0], None) | ||
| if value[:2] in ('<=', '=<'): | ||
| return (None, parse_datetime_value(value[2:])[0]) |
Contributor
Author
There was a problem hiding this comment.
The messed up operators here (>=, =<) couldn't actually be hit because they weren't specified in parse_datetime_expression so I removed them.
bretthoerner
approved these changes
Jul 10, 2018
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.