Behaviour with date filters with "invalid" queries #587
Unanswered
claremacrae
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Thank you for bringing this up, @claremacrae. I think it does matter, but I don't know how to solve it. In which cases exactly would we show an error? Specifically if someone uses the word For this specific case: we could add |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
In my early days of using the Tasks plugin, I often wrote filters like this:
I didn't get an error, but I found that I only got dates due on today.
Eventually I learned that I had to write it like this to get the correct results, and was mildly irritated that I didn't receive an error message.
Today I learned...
In writing tests for the new
happens
feature, I now understand why. I had tried to write some failing tests where there was gobbledegook instead ofbefore
,on
orafter
.What I believe is happening is that the date-parsing checks if the 2nd word is one of
before
,on
orafter
.If not, the entire remaining text is passed through to the date-parsing.
And the date-parsing is very forgiving, so a date of
by today
is treated astoday
- and theby
is just ignored, rather than being an error.Question
Does this matter?
Does this matter enough to do anything about it?
Beta Was this translation helpful? Give feedback.
All reactions