Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: marcus-sup@bar-coded.net (Marcus Williams)
Subject: [sup-talk] [PATCH] Chronic context fix
Date: Wed, 13 May 2009 10:02:31 +0100	[thread overview]
Message-ID: <1242205240-sup-5042@tomsk> (raw)

Chronic should use a context of :past for email date searches as emails
tend to be in the past. This fixes a problem when the wrong year is
guessed. To search for emails in the future you now need to be less
ambiguous (1 apr 2099 instead of 1 apr).
---
 lib/sup/index.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/index.rb b/lib/sup/index.rb
index 235a18c..779bf02 100644
--- a/lib/sup/index.rb
+++ b/lib/sup/index.rb
@@ -506,7 +506,7 @@ protected
       subs = subs.gsub(/\b(before|on|in|during|after):(\((.+?)\)\B|(\S+)\b)/) do
         break if chronic_failure
         field, datestr = $1, ($3 || $4)
-        realdate = Chronic.parse(datestr, :guess => false, :context => :none)
+        realdate = Chronic.parse(datestr, :guess => false, :context => :past)
         if realdate
           case field
           when "after"
-- 
1.5.4.1


             reply	other threads:[~2009-05-13  9:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13  9:02 Marcus Williams [this message]
2009-05-18 15:22 ` William Morgan

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

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

  git send-email \
    --in-reply-to=1242205240-sup-5042@tomsk \
    --to=marcus-sup@bar-coded.net \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox