More date: words (yesterday and thismonth)

This commit is contained in:
Charles Haley 2010-04-20 15:03:45 +01:00
parent f12c081bde
commit 5407459084

View File

@ -8,6 +8,7 @@ __docformat__ = 'restructuredtext en'
import collections, glob, os, re, itertools, functools import collections, glob, os, re, itertools, functools
from itertools import repeat from itertools import repeat
from datetime import timedelta
from PyQt4.QtCore import QThread, QReadWriteLock from PyQt4.QtCore import QThread, QReadWriteLock
from PyQt4.QtGui import QImage from PyQt4.QtGui import QImage
@ -236,6 +237,12 @@ class ResultCache(SearchQueryParser):
if query == _('today'): if query == _('today'):
qd = now() qd = now()
field_count = 3 field_count = 3
elif query == _('yesterday'):
qd = now() - timedelta(1)
field_count = 3
elif query == _('thismonth'):
qd = now()
field_count = 2
else: else:
try: try:
qd = parse_date(query) qd = parse_date(query)