unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "Sebastian Spaeth" <Sebastian@SSpaeth.de>
To: Keith Packard <keithp@keithp.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH] Make the date parser nicer
Date: Tue, 26 Jan 2010 12:50:41 +0100	[thread overview]
Message-ID: <874om99jam.fsf@SSpaeth.de> (raw)
In-Reply-To: <yunpr4xnzik.fsf@aiko.keithp.com>

On Mon, 25 Jan 2010 22:36:35 -0800, Keith Packard <keithp@keithp.com> wrote:
> Here's some code which further improves date parsing by allowing lots of
> date formats, including things like "today", "thisweek", ISO and US date
> formats and month names. You can separate two dates with .. to make a
> range, or you can just use the default range ("lastmonth" is everything
> From the 1st of the previous month to the 1st of the current month).
> 
> I think this fits nicely with your code.

It fit nicely indeed. I have just integrated your date parser into my
code and sent it as a series of 4 patches based on current cworth
master. (commits 2565fc6 and 96e11c3 will not compile on their own)

ec3c79a integrate keithp's date.c into the notmuch date parser and delete my previous own 
2565fc6 compile date.c as well
96e11c3 add date parser file from Keith
6ed2569 Make the date parser nicer.

The topic branch is here for those who don't want to apply mail patches:
http://github.com/spaetz/notmuch-all-feature/commits/dateparser3

Documentation of the new notmuch_parse_date function:
/* Parse a string into the first and last possible timestamps.
 * It parses the possible formats and stops if one pattern matches.
 * Keywords: 'today','yesterday','thisweek','lastweek','thismonth',
 *           'lastmonth'
 * Month-day : month[-day]] (month: January, Jan, or 1)\n"
 * ISO format: year[-month[-day]]
 * US format : month[/day[/year]]
 *
 * 'after' is used to fill in bits from context if left out, e.g. a
 * 'date:2004..01' will find from 2004-01-01 through 2004-01-31
 *
 * Return values:
 * NOTMUCH_STATUS_SUCCESS
 * NOTMUCH_STATUS_INVALID_DATE: Error parsing the date string

Please pull :-).

Sebastian

  parent reply	other threads:[~2010-01-26 11:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-22 15:26 [PATCH] Make the date parser nicer Sebastian Spaeth
2010-01-22 15:33 ` Sebastian Spaeth
2010-01-22 16:04 ` Sebastian Spaeth
2010-01-24 14:13 ` Sebastian Spaeth
2010-01-25 10:50   ` [PATCH] Make the date parser nicer. This is v3 and considered to be final (but the documentation) Sebastian Spaeth
2010-01-25 12:22     ` [PATCH] Make the date parser nicer (v3 + 'now' keyword) Sebastian Spaeth
2010-01-25 13:14       ` [PATCH] Make the date parser nicer (v3 + 'now' keyword) (final mail) Sebastian Spaeth
2010-01-26  6:36 ` [PATCH] Make the date parser nicer Keith Packard
2010-01-26  9:12   ` Sebastian Spaeth
2010-01-26 11:50   ` Sebastian Spaeth [this message]
2010-01-26 17:55     ` Keith Packard
2010-01-27  9:15       ` Sebastian Spaeth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874om99jam.fsf@SSpaeth.de \
    --to=sebastian@sspaeth.de \
    --cc=keithp@keithp.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).