docspell
docspell copied to clipboard
Support `today` in queries for custom fields with type date
I have some custom fields with the "date" type. When I query "due>=today", I get results based on today and all future relevant documents.
However with custom fields the behavior seems to be like this: "f:customfield>=today" => no results at all "f:customfield<=today" => results in past and future items (just like "f:customfield:*")
A workaround is to use "hardcoded/dynamic" dates like this: "f:customfield>=2022-07-15" (whereas 2022-07-15 is today)
I haven't tested other custom fields with other datatypes. But it might be worth a look, if there's a similar issue.
Maybe it's an issue of interpreting "today" rather than the operator...
Thanks for reporting!
So I had a look :) The thing is that date comparisons are not supported for custom fields atm. The comparison is always done alphanumerically. And since dates are stored as ISO strings, all of them are <= today
and none is >=
then. The docs don't mention this fact explicitly. This will turn now into a feature request and documentation bug 😄.
I'd simply like to second this feature request. It would be very useful to me as well. Thanks for looking into this!