mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More date: words (yesterday and thismonth)
This commit is contained in:
parent
f12c081bde
commit
5407459084
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user