From mboxrd@z Thu Jan 1 00:00:00 1970 From: marcus-sup@bar-coded.net (Marcus Williams) Date: Fri, 09 Nov 2007 20:44:08 +0000 Subject: [sup-talk] [PATCH] Natural language date searches In-Reply-To: <1194639409-sup-6180@tomsk> References: <1193436327-sup-5753@tomsk> <1193519205-sup-6445@tomsk> <1194633682-sup-962@south> <1194639409-sup-6180@tomsk> Message-ID: <1194640984-sup-1658@tomsk> On 9.11.2007, Marcus Williams wrote: > On 9.11.2007, William Morgan wrote: > > Modified to skip parsing if Chronic isn't available, and applied. > > Thanks! > > > > Also made it accept one-word Chronic tokens without parentheses, > > although "after:yesterday" means "after yesterday noon", which maybe is > > not so useful... > > I think I may have worked out how to fix that - change the parse > method to be: > > realdate = Chronic.parse(datestr, :guess => false).begin Mmmm - in fact it might be that you want to use .begin when you are searching "before", but .end when you are searching "after" That way searches like after:yesterday or after:(last monday) do what you expect. Patch attached Marcus -------------- next part -------------- A non-text attachment was scrubbed... Name: search-patch Type: application/octet-stream Size: 1111 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071109/1631a80b/attachment.obj