From 95215eded19fbdafef6196efd52bea67ef1739f1 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Mon, 28 Mar 2022 15:14:54 +0100 Subject: [PATCH] [Bug 1966611] Error in book details search: date/timestamp confusion --- src/calibre/ebooks/metadata/book/render.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/metadata/book/render.py b/src/calibre/ebooks/metadata/book/render.py index 4dbaf5173f..8439a142c6 100644 --- a/src/calibre/ebooks/metadata/book/render.py +++ b/src/calibre/ebooks/metadata/book/render.py @@ -281,13 +281,14 @@ def mi_to_html( if is_date_undefined(aval): continue aval = format_date(aval, 'yyyy-MM-dd') + key = field if field != 'timestamp' else 'date' if val == aval: val = '{}'.format( - search_action_with_data(field, str(aval), book_id, None, original_value=val), a( + search_action_with_data(key, 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 = '{}'.format( - search_action_with_data(field, str(aval), book_id, None, original_value=val), a( + search_action_with_data(key, str(aval), book_id, None, original_value=val), a( _('Click to see books with {0}: {1} (derived from {2})').format( metadata['name'] or field, aval, val)), val) elif metadata['datatype'] == 'text' and metadata['is_multiple']: