i just had the same problem for an hour, at some point it started working, now idea why, try copy/pasting what I did and go from there if it works
- event future #evenement [date:2026-06-27]
- even past #evenement [date:2025-01-07]
${query[[
from index.tag "evenement"
where date >= os.date("%Y-%m-%d")
order by _.date
select {
event = '[[' .. _.ref .. '|' .. _.name .. ']]',
date = _.date
}
]]}
If you’re using the legacy YYYY-mm-dd format I’d recommend moving away from that, it will go away in the next release, use the attribute syntax instead, eg [deadline: "YYYY-mm-dd"]
What may also go wrong here is that most tasks don’t have a deadline which means it is nil and comparing that with a string is not legal (probably that’s where the error comes from). You need to check for a value first, eg where _.deadline and _.deadline < …
Curious, is [deadline: “YYYY-mm-dd”] different from [deadline: YYYY-mm-dd] (no quotes)? Is one preferable? Both seem to work fine for me with queries.
If you use it without the quotes, YAML interprets (or tries to) interpret it as a YAML date, which SB later translates back to a string again, some surprising things may happen here. Not sure how it deals with time zones for instance. I’m not a heavy “date user” myself so haven’t looked too deeply into this.
I don’t think so, because those would end up being Date JavaScript objects. If we’d go that way all dates everywhere should be encoded that way (including Lua APIs) and I’m not sure the data layer evens supports this. Anyway, strings everywhere is simpler.
I think I was able to solve this issue. Probably there is a problem with comparison in case where there is a null deadline. So I added one additional statement:
${template.each( query[[ from index.tag 'task' where (_.deadline == date.today()) or (_.deadline != empty and _.deadline > date.today()) and not done ]], templates.taskItem )}