Re: [notmuch] [PATCH] Make the date parser nicer

Subject: Re: [notmuch] [PATCH] Make the date parser nicer

Date: Fri, 22 Jan 2010 16:33:12 +0100

To: notmuch@notmuchmail.org

Cc:

From: Sebastian Spaeth


Please find in the previous mail attached my patch (against my current
all-feature branch, but should pretty much apply to current master too).
It is a proof-of-concept to make the date parser nicer. The following 
searches work with this code:

notmuch show...
... date:2001..2010 (from beginning of 2001 until end of 2010)
... date:20011201..200506 (from 1001-12-01 until 2005-06-31

The code will pretty surely need some cleaning up, as I can hardly code
C, not to speak of C++. But at least it works and it is not very
intrusive.

(Ps. now that I think of it, I always use day 31 as last day, which is
surely wrong, it also still accepts some obviously wrong dates like
20040231)

We could also think about using a xapian DateValueRangeParser to do
that, but that would require saving the timestamp as YYYYMMDD in the
database (which we probably do not want).

Feedback welcome,
Sebastian

Thread: