mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-06 19:24:51 +01:00
...
This commit is contained in:
commit
d4b0a5b711
1 changed files with 2 additions and 5 deletions
|
|
@ -291,10 +291,6 @@ 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 not None:
|
||||
dt = as_local_time(dt)
|
||||
|
||||
if format == 'iso':
|
||||
format = 'yyMdhms'
|
||||
|
||||
|
|
@ -304,7 +300,8 @@ def clean_date_for_sort(dt, format):
|
|||
|
||||
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)
|
||||
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):
|
||||
# Replace months by english equivalent for parse_date
|
||||
|
|
|
|||
Loading…
Reference in a new issue