added: insert current date if note has tag "journal"

This commit is contained in:
quenousimporte 2023-12-11 11:04:39 +01:00
parent 207cd570e8
commit 263af2a863
1 changed files with 12 additions and 0 deletions

12
main.js
View File

@ -2991,6 +2991,18 @@ function defaultheaders(tags = "")
function loadnote(name) function loadnote(name)
{ {
var note = getorcreate(name, defaultheaders()); 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); bindfile(note);
stat.cur.q = 0; stat.cur.q = 0;