[PATCH v3 6/9] lib: add date range query support

Michal Sojka sojkam1 at fel.cvut.cz
Tue Sep 25 05:15:46 PDT 2012


On Thu, Sep 13 2012, Michal Nazarewicz wrote:
> On Wed, Sep 12 2012, Jani Nikula wrote:
>> Add a custom value range processor to enable date and time searches of
>> the form date:since..until, where "since" and "until" are expressions
>> understood by the previously added date/time parser, to restrict the
>> results to messages within a particular time range (based on the Date:
>> header).
>>
>> If "since" or "until" describes date/time at an accuracy of days or
>> less, the values are rounded according to the accuracy, towards past
>> for "since" and towards future for "until". For example,
>> date:november..yesterday would match from the beginning of November
>> until the end of yesterday. Expressions such as date:today..today
>> means since the beginning of today until the end of today.
>
> IMO this is totally unintuitive and not how the range should work.
> date:foo..bar should return messages whose date >= foo and < bar.  So
> for instance date:november..yesterday should return messages whose date
> is > 2012/11/01 00:00:00 and < 2012/09/12 00:00:00.  So to get
> yesterdays messages one would do: date:yesterday..today.

For me, date:monday..wednesday means all messages received on monday,
tuseday or wednesday. If I say Wednesday, I'm really interested in
Wednesday and not the day before Wednesday.

I'd also like to allow syntax like date:yesterday with the meaning all
messages sent yesterday. My idea how to implement this was described in
id:"87bovryqp0.fsf at steelpick.2x.cz". Unfortunately, I have no time to
implement it myself.

-Michal


More information about the notmuch mailing list