[RFC PATCH 0/2] natural language date range search

Jani Nikula jani at nikula.org
Sun Feb 19 14:55:50 PST 2012


Hi all, these patches add support for natural language date range search
of the form date:since..until, where since and until can be fairly free
form date/time expressions in English.

Examples:

date:two-days..yesterday (all mail in the two days before today)
date:12h.. (all mail since 12 hrs ago)
date:november..november (all mail in previous november)
date:2011.. (all mail since the beginning of 2011)
date:last-week..this-week (all mail over last and current week)
date:5/10/2011-12:34:55..10pm_2012-01-14

Plus plenty more and combinations of the above.

The repository for the date/time parser with a command line tool is at
[1], and there's a README [2] with a bunch of details too.


BR,
Jani.


[1] https://gitorious.org/parse-time-string/parse-time-string
[2] https://gitorious.org/parse-time-string/parse-time-string/blobs/master/README


Jani Nikula (2):
  lib: add date/time parser
  lib: add date range search

 lib/Makefile.local      |    2 +
 lib/database-private.h  |    1 +
 lib/database.cc         |    4 +
 lib/getdate-proc.cc     |   34 ++
 lib/getdate-proc.h      |   21 +
 lib/parse-time-string.c | 1304 +++++++++++++++++++++++++++++++++++++++++++++++
 lib/parse-time-string.h |   95 ++++
 7 files changed, 1461 insertions(+), 0 deletions(-)
 create mode 100644 lib/getdate-proc.cc
 create mode 100644 lib/getdate-proc.h
 create mode 100644 lib/parse-time-string.c
 create mode 100644 lib/parse-time-string.h

-- 
1.7.5.4



More information about the notmuch mailing list