mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 21:18:32 +02:00
Use strict date matching, if using the default time format
This commit is contained in:
parent
12e01656f0
commit
851f8ef0c6
1 changed files with 5 additions and 0 deletions
|
@ -128,6 +128,11 @@ class Journal:
|
||||||
entries = []
|
entries = []
|
||||||
|
|
||||||
date_blob_re = re.compile("(?:^|\n)\\[([^\\]]+)\\] ")
|
date_blob_re = re.compile("(?:^|\n)\\[([^\\]]+)\\] ")
|
||||||
|
|
||||||
|
# Use strict date matching, if using the default time format
|
||||||
|
if self.config["timeformat"] == '%Y-%m-%d %H:%M':
|
||||||
|
date_blob_re = re.compile("(?:^|\n)\\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2})\\] ")
|
||||||
|
|
||||||
last_entry_pos = 0
|
last_entry_pos = 0
|
||||||
for match in date_blob_re.finditer(journal_txt):
|
for match in date_blob_re.finditer(journal_txt):
|
||||||
date_blob = match.groups()[0]
|
date_blob = match.groups()[0]
|
||||||
|
|
Loading…
Add table
Reference in a new issue