What I’m trying to do
Make a table to display tasks from a file where the tasks might be listed as follows:
- Ch. 9 [due:: 2025-01-27T21:00] [state:: in-progress]
- [[Ch. 10]] [due:: 2025-01-30T14:00]
- Review work done [due:: 2025-02-01T10:00]
And display “Today” if the date is today.
Things I have tried
I am currently trying the following:
TABLE WITHOUT ID
text as Item,
choice(striptime(tasks.due) = date(today), "Today", dateformat(tasks.due, "ccc")) as Day,
dateformat(tasks.due, "T") as Time,
tasks.state as Status
WHERE file = this.file
FLATTEN file.tasks as tasks
WHERE tasks.due
WHERE !tasks.completed
FLATTEN regexreplace(tasks.text, " \[.*$", "") as text
SORT tasks.due ASC
It mostly works but has the following problems:
Item column displays the task name plus the text of the in-line field.Solved this using regexreplace via this post.Date condition checking not working: Day doesn’t display as “Today” even when the date is today’s date.Solved this by finding the striptime function.
Update: Solved most of the problems myself (will leave this here for others) but one more small one: If there is no time listed, I’d love to have it display “-” instead of 00:00 as it currently does.
I tried
choice(dateformat(tasks.due, "T") > 00:00, dateformat(tasks.due, "T"), "-") as Time
but that doesn’t work. Any suggestions?