feat: add date math for filters #1086
No reviewers
Labels
No Label
dependencies
duplicate
help wanted
invalid
kind/bug
kind/feature
needs reproduction
question
security
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/vikunja#1086
Loading…
Reference in New Issue
No description provided.
Delete Branch "feature/relative-time"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
This PR adds support for relative dates in filters, similar to the ones from grafana or elasticsearch.
In short, it allows you to filter for due dates by passing in dates like "now - 7d" to get a date from 7 days ago.
This is a very powerful addition for saved filters as they will allow you to create filters for all kinds of stuff where you previously only could use fixed dates. Now you can for example create a saved filter for "all tasks this week".
Frontend PR: vikunja/frontend#1342
Checklist
I think this definitely needs docs in the frontend.
This is really cool!
Is it be possible to add an offset to the dates?
You mean something to get the tasks for this month or the next month?
I was thinking of that I always hate it when after 00:00 systems say that the new day bagan (which it obviously did) but my day - in the sense of awake period - didn't end yet.
We had somewhere a discussion about a system setting that configures this.
I guess this might be a location where we want to use the same number
I think that could work with this PR. Something like
now/d+3h
should result in "3:00 am today" so using that as afrom
date (and the equivalent forto
) should give you all tasks from 3am today to 3am tomorrow.Maybe it's worth to have a look at all the possible dynamic and recurring filters Todoist implements if it helps in some away with this 😁
https://todoist.com/help/articles/introduction-to-filters
Thank you so much !
What todoist does is a really interesting concept, thanks for the pointer. Would love to do something similar to this at some point, this PR "only" provides date math though. I think it's a step in the direction of what todoist does.
ae3a740763
tofbc856eb6c