I have never understood why mailboxes and issue trackers make date based searches so difficult. By this I mean why is the task of specifying a date (or range) of records to search for not easier?
For example, to search for emails before a particular date in gmail, you can use
older_than:2d. It doesn't look particularly hard, but let's say I wanted to search for emails received last week only. I would need to open up a calendar, look up the relevant dates and only then could I enter the right incantation:
With issue trackers that I have used, the story is not much different except for JIRA.
- Github Issues accepts ISO-8601 dates only e.g.
- Trello seems to accept only relative dates, but is slightly more tolerable as searching for cards created or due this day/week/month is easier e.g.
- Asana doesn't have a pure text based way to specify dates, you have to necessarily use the UI.
- JIRA is better — it allows searching by ISO dates, relative dates (
-2d, etc.), and also has functions like
endOfWeek(), etc. Searching for issues created last week would look like
created >= startOfWeek(-1) and created <= endOfWeek(-1).
Still, even JIRA leaves a lot to be desired. While date based searches are not the most common activity, they are frequent enough that one has to wonder why no one ever picked up an NLP date parsing library for this. It would be so much nicer if I could just tell gmail to return all emails that were
received:"last week" or something similar.
How deftask handles date based searches
deftask does exactly what I wished these other systems would do.
created:todayreturns tasks created today
created:mondayreturns tasks created last Monday
updated:"five days ago"returns tasks updated five days ago
created:"last week"returns tasks created last week
updated:januaryreturns task updated last January
created:"this year"returns tasks updated from the beginning of the year till now.
- ISO based dates like
created:2018-12-01also work as expected
You can also specify date ranges explicitly using the operators
created:>novemberreturns tasks created after the end of November
created:>=novemberreturns tasks created since the beginning of November
created:>=september created:<"this week"returns tasks created after beginning of September and before this week
If you want to avoid typing double quotes around multi-word date strings, you can use underscores instead of spaces i.e.
created:this_week will also work. This is especially useful if you use deftask-cli.
Searching dates this way is a breeze – much nicer than the alternatives! If you are a deftask user, go ahead and try it out when searching for your tasks.