From 4069b1d15d438ebc2d58a922b5c03d96571b7cc6 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 26 Jan 2016 11:43:23 -0600 Subject: [PATCH] Apply *_format ini option to date/time types. For calibre_* columns passed in. --- fanficfare/story.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fanficfare/story.py b/fanficfare/story.py index 25076f5..4ef19ce 100644 --- a/fanficfare/story.py +++ b/fanficfare/story.py @@ -654,6 +654,9 @@ class Story(Configurable): value = value.strftime(self.getConfig(key+"_format","%Y-%m-%d %H:%M:%S")) if key in ("datePublished","dateUpdated"): value = value.strftime(self.getConfig(key+"_format","%Y-%m-%d")) + if isinstance(value, (datetime.date, datetime.datetime, datetime.time)) and self.hasConfig(key+"_format"): + # logger.info("DATE: %s"%key) + value = value.strftime(self.getConfig(key+"_format")) if key == "title" and (self.chapter_first or self.chapter_last) and self.getConfig("title_chapter_range_pattern"): first = self.chapter_first or "1"