My first post since starting on the Obsidian journey (ex Notion user and loving it!)
I’ve been playing with Dataview and have managed to get it to do some impressive things so far, but my knowledge of combining Dataview with other aspects, like Template(r) are limited. I’ve looked through the dataview and templater docs but can’t work out how to do the following…
So I’m making a daily journal, title in format [[YYYY-MM-DD]] and want to use dataview to pull in all notes created on the date specified in the title. Issue is that I don’t always journal on the day that the title date of journal refers to. Essentially what i’m after is if I am completing a journal note for last friday, for example, then I want dataview to show notes that I created on that date (via the title, e.g [[YYYY-MM-DD]]. I want a separate table to show all notes that I modified on that date too. I just can’t get this to work
This is what I have so far for ‘created on date’:
TABLE file.ctime as “Created”
WHERE file.cday = date(this.file.name)
SORT file.ctime DESC
Well, with your query you get the files created on the same date of your daily note. You can replace your query by this (with the format “YYYY-MM-DD” you can get a date with the implicit field file.day):
TABLE file.ctime as "Created"
WHERE file.cday = this.file.day
SORT file.ctime DESC
Your second point… well, you have a problem! Dataview results are dynamic: what you see is the “actual” metadata, when you run the query. It’s a “view”. Modified date is also a dynamic date. The value in file.mday or file.mtime change every time you made modifications to your file. Then, if you use a query with the modification date this value changes accordingly.
This to say that you can’t have a “stable” table in a specific daily note. If your goal is «know all the files that I modified in this date", if in the next day you modify a file in that list then the file move out from results in the previous daily note query.
You are awesome! Thank you
Yup, to the second point, the modified notes are just so I can track things i’ve worked on over the day in my journal so I can manually journal changes made to notes if needed… so it’s just a point of reference
Awesome, i had exactly that code in my dataview lol! I’m on the right track
While I have you, one more qu if it’s okay? I’m using Syncthing to sync files across phone/tablet/server/desktop. They’re all linux based, but for some reason the 'created date sometimes changes. I think it’s related to when I add a new node to the network, not sure.
Either way, in my YAML I have a field for ‘created’, which stores data in the following format:
created: “2022-04-29 11:28”
I’d prefer to use that YAML field from my notes to compare against the date of the journal (using it’s title), but I’m not sure how to translate from YYYY-MM-DD to “YYYY-MM-DD HH:mm” inside the dataview codeblock without dropping the time. Any ideas?