fixed: add events after todo header

This commit is contained in:
quenousimporte 2023-06-15 08:58:47 +02:00
parent b992e1fbe5
commit c68d259ec9
1 changed files with 9 additions and 2 deletions

11
main.js
View File

@ -1313,8 +1313,15 @@ function checkevents()
{
showtemporaryinfo("Calendar changes to check");
var todo = getnote("todo");
var content = todo.content;
todo.content = newcontent.join("\n") + "\n" + content;
var idx = 0;
if (todo.content.startsWith("---"))
{
idx = todo.content.indexOf("---", 3) + 4;
}
todo.content = todo.content.substring(0, idx)
+ newcontent.join("\n")
+ "\n"
+ todo.content.substring(idx);
// reload todo if open
if (currentnote == todo)