From 54074590847fdfab52466ce96e2e6fc5e726963c Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Tue, 20 Apr 2010 15:03:45 +0100 Subject: [PATCH] More date: words (yesterday and thismonth) --- 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 79115eb96a..df6e78759f 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -8,6 +8,7 @@ __docformat__ = 'restructuredtext en' import collections, glob, os, re, itertools, functools from itertools import repeat +from datetime import timedelta from PyQt4.QtCore import QThread, QReadWriteLock from PyQt4.QtGui import QImage @@ -236,6 +237,12 @@ class ResultCache(SearchQueryParser): if query == _('today'): qd = now() field_count = 3 + elif query == _('yesterday'): + qd = now() - timedelta(1) + field_count = 3 + elif query == _('thismonth'): + qd = now() + field_count = 2 else: try: qd = parse_date(query)