From d547dca676553a83c077b34f735c9d2ff5d41dcd Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Tue, 15 Nov 2022 21:24:52 +0100 Subject: daterange: support relative terms Support relative terms when writing date ranges in the search and filter commands with the -d flag. Syntax is inspired by the notmuch search terms. Terms can be written with spaces or underscores for a better readability, so both "this_week" and "this week" are allowed. Terms are not case-sensitive. Some terms can be prefixed with either "this" or "last" where applicable ("this" is assumed by default if omitted): - "today", "yesterday" - ("this"|"last") "year", "month", "week" - all weekdays (e.g. "Tuesday", "last_wed") - all months (e.g. "January", "last_feb") Note that "month" should always be spelled out to prevent a possible ambiguity with "Monday". Weekdays and months do not need to be written out completely, i.e. "February..March" and "Feb..Mar" are both understood. Relative date terms can be used with the syntax where N is a positive integer indicating the number of time units in the past from today. The units can be abbreviated with a single letter, e.g. "1w 1d.." is the same as "1 week 1 day..". More examples: :filter -d yesterday :filter -d last_monday.. :filter -d mon..sat :filter -d 1y1m1w1d.. :search -d this_week "PATCH aerc" Signed-off-by: Koni Marti Acked-by: Robin Jarry --- doc/aerc-search.1.scd | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc/aerc-search.1.scd') diff --git a/doc/aerc-search.1.scd b/doc/aerc-search.1.scd index 51e93ade..8349874b 100644 --- a/doc/aerc-search.1.scd +++ b/doc/aerc-search.1.scd @@ -44,6 +44,25 @@ aerc-search - search and filter patterns and options for *aerc*(1) Search for messages within a particular date range defined as \[start, end) where the dates are in the YYYY-MM-DD format. + Relative dates can be used to specify a date range. Spaces and + underscores are allowed to improve readability: + + *today*, *yesterday* + + *(this|last) (year|month|week)* + + *Weekdays*, *Monthnames* + Can also be abbreviate, so Monday..Tuesday can written + as Mon..Tue and February..March as Feb..Mar. + + __ *(y[ear]|m[onth]|w[eek]|d[ay])* + __ is a positive integer that represents the number + of the time units in the past. Mutiple relative terms + can will be accumulated. The units can also be + abbreviated by a single letter such that yesterday would + correspond to _1d_ (equivalent to _1 day_ or _1_day_) + and _8 days ago_ would be either _1w1d_ or _8d_. + # NOTMUCH *search* _query_... -- cgit