CSV Catalogs: Output all custom datetime columns in the local timezone to match the format for builtin columns

This commit is contained in:
Kovid Goyal 2014-10-09 08:22:45 +05:30
parent e828f7d41d
commit 713153a965

View File

@ -14,6 +14,7 @@ from calibre.customize.conversion import DummyReporter
class CSV_XML(CatalogPlugin):
'CSV/XML catalog generator'
Option = namedtuple('Option', 'option, default, dest, action, help')
@ -135,7 +136,7 @@ class CSV_XML(CatalogPlugin):
elif field == 'isbn':
# Could be 9, 10 or 13 digits, with hyphens, possibly ending in 'X'
item = u'%s' % re.sub(r'[^\dX-]', '', item)
elif field in ['pubdate', 'timestamp']:
elif fm.get(field, {}).get('datatype') == 'datetime':
item = isoformat(item, as_utc=False)
elif field == 'comments':
item = item.replace(u'\r\n', u' ')