mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Bug 1950758: Book details: Adjustments to search when clicking on a datetime column
Search never uses the time and timezone so suppress them from the search string.
This commit is contained in:
parent
9375ee1ed5
commit
0613b43364
@ -16,7 +16,7 @@ from calibre.constants import filesystem_encoding
|
|||||||
from calibre.library.comments import comments_to_html, markdown
|
from calibre.library.comments import comments_to_html, markdown
|
||||||
from calibre.utils.icu import sort_key
|
from calibre.utils.icu import sort_key
|
||||||
from calibre.utils.formatter import EvalFormatter
|
from calibre.utils.formatter import EvalFormatter
|
||||||
from calibre.utils.date import is_date_undefined
|
from calibre.utils.date import is_date_undefined, format_date
|
||||||
from calibre.utils.localization import calibre_langcode_to_name
|
from calibre.utils.localization import calibre_langcode_to_name
|
||||||
from calibre.utils.serialize import json_dumps
|
from calibre.utils.serialize import json_dumps
|
||||||
from polyglot.binary import as_hex_unicode
|
from polyglot.binary import as_hex_unicode
|
||||||
@ -281,6 +281,12 @@ def mi_to_html(
|
|||||||
aval = getattr(mi, field)
|
aval = getattr(mi, field)
|
||||||
if is_date_undefined(aval):
|
if is_date_undefined(aval):
|
||||||
continue
|
continue
|
||||||
|
aval = format_date(aval, 'yyyy-MM-dd')
|
||||||
|
if val == aval:
|
||||||
|
val = '<a href="%s" title="%s">%s</a>' % (
|
||||||
|
search_action_with_data(field, str(aval), book_id, None, original_value=val), a(
|
||||||
|
_('Click to see books with {0}: {1}').format(metadata['name'] or field, val)), val)
|
||||||
|
else:
|
||||||
val = '<a href="%s" title="%s">%s</a>' % (
|
val = '<a href="%s" title="%s">%s</a>' % (
|
||||||
search_action_with_data(field, str(aval), book_id, None, original_value=val), a(
|
search_action_with_data(field, str(aval), book_id, None, original_value=val), a(
|
||||||
_('Click to see books with {0}: {1} (derived from {2})').format(
|
_('Click to see books with {0}: {1} (derived from {2})').format(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user