I am playing around with Bases and looking to see if it can replace dataview for at least some of my needs.
The simplest DV query that I have is a “all notes created/edited $today” which is implemented using the user scripts:
// if input.filter_date is not defined, default to today
if (!input.filter_date) {
input.filter_date = new Date().toISOString().split('T')[0];
}
dv.execute(`
TABLE dateformat(file.cday, "yyyy-MM-dd") as "Created${input.exclude_self ? '(excluding self)' : ' (including self)'}"
WHERE file.cday.year = date(${input.filter_date}).year
AND file.cday.month = date(${input.filter_date}).month
AND file.cday.day = date(${input.filter_date}).day
${input.exclude_self ? 'AND file.path != this.file.path' : ''}
SORT file.cday desc
`);
And then in my daily note template, I have this:
# Heading
- And other markdown content here
## today's activity
```dataviewjs
await dv.view("_meta/dv/dv_daily_activity", {filter_date: "<%today%>", exclude_self: false});
```
Which would render a very basic table showing any file that was created today.
What I’m trying to do
I would like to have a daily-activity.base file that can be embedded in each daily note so the base renders notes only from $thatDay.
I can’t use now() because that will always be $today and I can’t figure out how to pass inputs to filters / functions or even reference $self (the location /note where the base is being displayed).
If $self was an option then I could - theoretically - write a basic:
filters:
and:
- file.ctime > $self.ctime #insert code(?) here to cut the H:M:S out of ctime, just to scope it to the day.
Things I have tried
- Searching this forum / reddit / HN discussion threads
- Play around with the base builder gui/the raw
.basefile on disk
