From 263af2a86380f53a7b36bb4171fd984644c43727 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Mon, 11 Dec 2023 11:04:39 +0100 Subject: [PATCH] added: insert current date if note has tag "journal" --- main.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.js b/main.js index 78ff53e..a1a29bb 100644 --- a/main.js +++ b/main.js @@ -2991,6 +2991,18 @@ function defaultheaders(tags = "") function loadnote(name) { var note = getorcreate(name, defaultheaders()); + + if (gettags(note).includes("journal")) + { + var hat = headerandtext(note); + var today = timestamp().substr(0,10); + if (!hat.text.startsWith("\n" + today)) + { + note.content = hat.header + "\n" + today + "\n\n" + hat.text; + note.pos = hat.header.length + 12; + } + } + bindfile(note); stat.cur.q = 0;