diff options
Diffstat (limited to 'modules/blogpost_processor.py')
| -rw-r--r-- | modules/blogpost_processor.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/blogpost_processor.py b/modules/blogpost_processor.py index 39e2238..93dcfb4 100644 --- a/modules/blogpost_processor.py +++ b/modules/blogpost_processor.py @@ -111,11 +111,14 @@ class Post: def get_link(self): return urllib.parse.urljoin(Config.BLOG_ROOT_URL, self.href) + def get_publish_date(self) -> str: + return self.get_publish_time().split()[0] + def get_publish_time(self) -> str: return self.meta_data[PUBLISH_DATE_KEY] def get_publish_time_rfc2822(self) -> str: - return email.utils.format_datetime(datetime.datetime.fromisoformat(self.get_publish_time() + " 12:00+02:00")) + return email.utils.format_datetime(datetime.datetime.fromisoformat(self.get_publish_time() + "+02:00")) def get_publish_year(self) -> str: return self.meta_data[PUBLISH_DATE_KEY][0:4] @@ -168,7 +171,7 @@ class Post: for post in other_posts: lines.append("lrwxrwxrwx 1 {} {} {} {} 11:11 '{}' -> {}".format( # TODO random time and fix filename escape - Config.BLOG_OWNER, Config.BLOG_OWNER, len(post.get_fake_path()), post.get_publish_time(), post.title(), + Config.BLOG_OWNER, Config.BLOG_OWNER, len(post.get_fake_path()), post.get_publish_date(), post.title(), post.get_fake_path()) ) |
