How to rewrite this, so that it calculates based on date from file title instead of current date?

How to rewrite this, so that it calculates based on date from my file title of my daily note (YYYY-MM-DD) instead of current date? (It calculates the day number in the current quarter).

`$= dv.date("now").toFormat("ooo") - dv.date("now").startOf("quarter").toFormat("ooo") + 1` 

I have tried many things, but haven’t succeeded.

If your file title has the date in it, then the file.day should hold the date of that file. You seem to be using the current file, so then this becomes this.file.day, and your query becomes something like:

`$= const d = dv.current().file.day; dv.span(parseInt(d.toFormat("ooo")) - parseInt(d.startOf("quarter").toFormat("ooo")))`
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.