Fix the publishstart option in advsearch

This commit is contained in:
xlivevil 2021-09-25 22:10:46 +08:00
parent bf5de95fdc
commit fed9eff7b8
No known key found for this signature in database
GPG Key ID: D4D073C8E61991AF
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@
<div class="form-group col-sm-6">
<label for="publishstart">{{_('Published Date From')}}</label>
<div class="input-group">
<input type="text" style="position: static;" class="datepicker form-control" name="publish_start" id="publishstart" value="">
<input type="text" style="position: static;" class="datepicker form-control" name="publishstart" id="publishstart" value="">
<input type="text" style="position: absolute;" class="form-control fake-input hidden" id="fake_publishstart" value="">
<span class="input-group-btn">
<button type="button" id="publishstart_delete" class="datepicker_delete btn btn-default"><span class="glyphicon glyphicon-remove-circle"></span></button>

View File

@ -1224,7 +1224,7 @@ def extend_search_term(searchterm,
format_date(datetime.strptime(pub_end, "%Y-%m-%d"),
format='medium', locale=get_locale())])
except ValueError:
pub_start = u""
pub_end = u""
elements = {'tag': db.Tags, 'serie':db.Series, 'shelf':ub.Shelf}
for key, db_element in elements.items():
tag_names = calibre_db.session.query(db_element).filter(db_element.id.in_(tags['include_' + key])).all()
@ -1295,7 +1295,7 @@ def render_adv_search_results(term, offset=None, order=None, limit=None):
column_end = term.get('custom_column_' + str(c.id) + '_end')
if column_start:
searchterm.extend([u"{} >= {}".format(c.name,
format_date(datetime.strptime(column_start, "%Y-%m-%d"),
format_date(datetime.strptime(column_start, "%Y-%m-%d").date(),
format='medium',
locale=get_locale())
)])