mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
commit
d4b0a5b711
@ -291,10 +291,6 @@ def clean_date_for_sort(dt, format):
|
|||||||
if not isinstance(dt, datetime):
|
if not isinstance(dt, datetime):
|
||||||
dt = datetime.combine(dt, time())
|
dt = datetime.combine(dt, time())
|
||||||
|
|
||||||
if hasattr(dt, 'tzinfo'):
|
|
||||||
if dt.tzinfo is not None:
|
|
||||||
dt = as_local_time(dt)
|
|
||||||
|
|
||||||
if format == 'iso':
|
if format == 'iso':
|
||||||
format = 'yyMdhms'
|
format = 'yyMdhms'
|
||||||
|
|
||||||
@ -304,7 +300,8 @@ def clean_date_for_sort(dt, format):
|
|||||||
|
|
||||||
repl_func = partial(cd_repl_func, tt, dt)
|
repl_func = partial(cd_repl_func, tt, dt)
|
||||||
re.sub('(s{1,2})|(m{1,2})|(h{1,2})|(d{1,4}|M{1,4}|(?:yyyy|yy))', repl_func, format)
|
re.sub('(s{1,2})|(m{1,2})|(h{1,2})|(d{1,4}|M{1,4}|(?:yyyy|yy))', repl_func, format)
|
||||||
return datetime(tt['year'], tt['mon'], tt['day'], tt['hour'], tt['min'], tt['sec'])
|
return dt.replace(year=tt['year'], month=tt['mon'], day=tt['day'], hour=tt['hour'],
|
||||||
|
minute=tt['min'], second=tt['sec'], microsecond=0)
|
||||||
|
|
||||||
def replace_months(datestr, clang):
|
def replace_months(datestr, clang):
|
||||||
# Replace months by english equivalent for parse_date
|
# Replace months by english equivalent for parse_date
|
||||||
|
Loading…
x
Reference in New Issue
Block a user