<%* const fm = tp.frontmatter; const created = fm.created || tp.file.creation_date("YYYY-MM-DD[T]HH:mm:ss"); const date = fm.date || String(created).substring(0,10); let time = String(created).substring(11,16); if (!title){ title = await tp.system.prompt("Enter title") } else{ title = fm.title } // Rename the file using the extracted date + current title let HHmm = time.replace(/:/g, "").substring(0, 4); await tp.file.rename(`${date} ${HHmm} ${title}`); -%> --- date: <% date %> created: <% created %> up: - "[[Journal]]" title: <% title %> tags: --- <% created %>