mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Use "localtime" in clean_date_for_sort, which is more likely to be what the user is really looking at. Continue to use non-naive dates so that differences in DST are taken into account.
This commit is contained in:
parent
71b59c4a1b
commit
25ab93133d
@ -291,6 +291,11 @@ def clean_date_for_sort(dt, format):
|
||||
if not isinstance(dt, datetime):
|
||||
dt = datetime.combine(dt, time())
|
||||
|
||||
if hasattr(dt, 'tzinfo'):
|
||||
if dt.tzinfo is None:
|
||||
dt = dt.replace(tzinfo=_local_tz)
|
||||
dt = as_local_time(dt)
|
||||
|
||||
if format == 'iso':
|
||||
format = 'yyMdhms'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user