]> git.cworth.org Git - sup/commitdiff
Chronic context fix
authorMarcus Williams <marcus-sup@bar-coded.net>
Wed, 13 May 2009 09:02:31 +0000 (10:02 +0100)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 18 May 2009 14:53:54 +0000 (10:53 -0400)
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

index 853bf7603556df49e97d6926eb9969cf4187168e..7642e08b2916d202693041185c88ec9e74491a7b 100644 (file)
@@ -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"