1
0
Fork 0
digital-anti-bad-habit-note.../_Templates/Habit.md

17 lines
587 B
Markdown
Raw Normal View History

2024-12-03 23:58:57 +00:00
<%*
let habit = await tp.system.suggester((item) => item, ["Habit1", "Habit2"])
let current_ts = tp.date.now("YYYY-MM-DD HH:mm")
let filename = tp.file.title
if ( filename.startsWith("Untitled") ) {
filename = tp.date.now("YYYY-MM-DD-HHmm")
let path = "/Log/" + habit + tp.date.now("/YYYY/MM/DD/")
await tp.file.move(path + filename)
}
%>---
created_ts: <% current_ts %>
habit: <% habit %>
quantity: <% tp.system.prompt("Quantity", "", true, false) %>
unit: <% tp.system.suggester((item) => item, ["oz", "mg", "cigarette", "beer", "second", "session"]) %>
tags:
- <% habit %>
---