commit 14764294658b2fdac47a06894e9a965b9c97776a
parent 01316aff4da1e7ff74dc3fac4578251b80807528
Author: Marcus Williams <marcus-sup@bar-coded.net>
Date: Wed, 13 May 2009 10:02:31 +0100
Chronic context fix
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).
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/index.rb b/lib/sup/index.rb
@@ -552,7 +552,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"