From 74309cf722e44351e012dbffb8d2b72207bfc483 Mon Sep 17 00:00:00 2001 From: Dominik Fischer Date: Sun, 24 Jun 2018 19:50:59 +0200 Subject: [PATCH] added config option for locale to make date output work nicer --- jrnl/Entry.py | 3 +++ jrnl/install.py | 1 + 2 files changed, 4 insertions(+) diff --git a/jrnl/Entry.py b/jrnl/Entry.py index 66b32f6c..bba1c731 100755 --- a/jrnl/Entry.py +++ b/jrnl/Entry.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import re import textwrap from datetime import datetime +import locale class Entry: @@ -16,6 +17,8 @@ class Entry: self.tags = self.parse_tags() self.starred = starred self.modified = False + locale.setlocale(locale.LC_TIME, self.journal.config['locale']) + @staticmethod def tag_regex(tagsymbols): diff --git a/jrnl/install.py b/jrnl/install.py index 138cb826..47488e42 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -28,6 +28,7 @@ default_config = { 'default_hour': 9, 'default_minute': 0, 'timeformat': "%Y-%m-%d %H:%M", + 'locale': "en_US", 'tagsymbols': '@', 'highlight': True, 'linewrap': 79,