From 96c95279d1808bdc2d5f06ec29e1ad8cb37af42b Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Tue, 20 Apr 2010 17:50:41 +0100 Subject: [PATCH] Added the 'daysago' date search --- src/calibre/library/caches.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index df6e78759f..4a38d386a6 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -243,6 +243,13 @@ class ResultCache(SearchQueryParser): elif query == _('thismonth'): qd = now() field_count = 2 + elif query.endswith(_('daysago')): + num = query[0:-len(_('daysago'))] + try: + qd = now() - timedelta(int(num)) + except: + raise ParseException(query, len(query), 'Number conversion error', self) + field_count = 3 else: try: qd = parse_date(query)