Specific goal: To get the ctime or cday of a file, when I only have the path (ie, a string and not an object) to that file.
Details: I want to collate the list items from several daily pages. I’m approaching it from a “tasks” mindset. For example
var myCurrentPage = dv.pages('"reviews/daily"');
const myArrayTasks = myCurrentPage.file.tasks
And then I do some text processing with each task in the myArrayTasks.
I see that there are “implicit fields” (listed on Metadata on Tasks and Lists - Dataview) such as:
item.tags
item.path
which are:
a list of 1 element: “#books”
a string “/reviews/daily/2022-12-28”
What I can’t figure out is how to get the date of the page which holds a particular list item. I have a string of the path, but to get the ctime or cday of that path, I think I have to convert it to an object. (Right? Maybe that’s an incorrect assumption.)
But the example given in the Dataview documentation about constructors doesn’t work for me:
https://blacksmithgu.github.io/obsidian-dataview/reference/functions/#objectkey1-value1
Constructors
Constructors which create values.
object(key1, value1, ...)
Creates a new object with the given keys and values. Keys and values should alternate in the call, and keys should always be strings/text.
object() => empty object object("a", 6) => object which maps "a" to 6 object("a", 4, "c", "yes") => object which maps a to 4, and c to "yes"
My simple test
object("a",6)
gives an error which returns no search results:
Evaluation Error: ReferenceError: object is not defined
Things I have tried
I tried searching on “Evaluation Error: ReferenceError: object is not defined” and tried creating an object with the JSON method, but I keep getting errors.
Maybe a better approach is to iterate over each page in a range of dates, but I couldn’t figure that out, either.