Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] Chronic context fix
@ 2009-05-13  9:02 Marcus Williams
  2009-05-18 15:22 ` William Morgan
  0 siblings, 1 reply; 2+ messages in thread
From: Marcus Williams @ 2009-05-13  9:02 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [sup-talk] [PATCH] Chronic context fix
  2009-05-13  9:02 [sup-talk] [PATCH] Chronic context fix Marcus Williams
@ 2009-05-18 15:22 ` William Morgan
  0 siblings, 0 replies; 2+ messages in thread
From: William Morgan @ 2009-05-18 15:22 UTC (permalink / raw)


Reformatted excerpts from Marcus Williams's message of 2009-05-13:
> 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).

Applied, thanks!
-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-18 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-13  9:02 [sup-talk] [PATCH] Chronic context fix Marcus Williams
2009-05-18 15:22 ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox