mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Added the 'daysago' date search
This commit is contained in:
parent
5407459084
commit
96c95279d1
@ -243,6 +243,13 @@ class ResultCache(SearchQueryParser):
|
|||||||
elif query == _('thismonth'):
|
elif query == _('thismonth'):
|
||||||
qd = now()
|
qd = now()
|
||||||
field_count = 2
|
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:
|
else:
|
||||||
try:
|
try:
|
||||||
qd = parse_date(query)
|
qd = parse_date(query)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user