docs(obsidian-bases): date subtraction returns milliseconds, not a Duration with `.days`
Problem
skills/obsidian-bases/SKILL.md and skills/obsidian-bases/references/FUNCTIONS_REFERENCE.md still document a Duration type with .days / .hours / … fields, and formulas such as (date(due_date) - today()).days. Agents following this guidance generate .base formulas that do not match current Bases behavior.
Evidence: official docs now say milliseconds
https://help.obsidian.md/bases/syntax("Date arithmetic"): "Subtract two dates to get the millisecond difference between the two, for example,now() - file.ctime."https://help.obsidian.md/bases/syntax("Dates and durations" section): "(now() + "1d") - now() returns86400000milliseconds."
I couldn't find a documented .days field on the result of date subtraction in the current docs.
Impact on agents
This is exactly the kind of error that is worse than a crash: the formula may fail only when the agent has already written several .base files, or it may be silently wrong in generated task trackers.
Proposed fix
In skills/obsidian-bases/SKILL.md:
days_old: '(now() - file.ctime).days'→days_old: '((now() - file.ctime) / 86400000).floor()'days_until_due: 'if(due_date, (date(due_date) - today()).days, "")'→days_until_due: 'if(due_date, ((date(due_date) - today()) / 86400000).round(0), "")'
In references/FUNCTIONS_REFERENCE.md, replace the "Duration Type" section with a "Date differences" section:
- Subtracting two date objects returns a number of milliseconds.
- Convert explicitly (
/ 86400000for days) before using number functions such as.round(),.floor(),.ceil(). - The
duration()function parses strings like"1d"for arithmetic; it does not mean date subtraction returns a Duration object.
Related
- The current
.daystext was introduced in merged PR #35; the official docs have since moved to millisecond subtraction. - Closed PR #133 contained exactly this millisecond correction (e.g.
((date(due_date) - today()) / 86400000).round(0)) but was never merged.
Source: kepano/obsidian-skills