Dataviewjs. t.text.includes date from file title

What I’m trying to do

Hello, I am very new to dataview and this is the first time I have tried to use dataviewjs.

I want to add a dataviewjs query in my daily note that fetches uncompleted tasks from my vault where the task text has the daily notes title date.

So every daily note dataviewjs fetches the tasks with text that matches the daily notes title date.

Daily Note = “2024-08-26 Monday” YYYY-MM-DD DDD

Fetches task in other file in Vault

  • Put pants on, one leg at a time [[2024-08-26 Monday]]

I have the below dataviewjs from Nicole van der Hoeven

dv.taskList(dv.pages().file.tasks 
  .where(t => !t.completed)
  .where(t => t.text.includes("{{date:YYYY-MM-DD}}")))

Things I have tried

I’ve tried a few things in the t.text.includes(???) but not having any luck.

Think this is prob a very low level noob question. Anyone able to give me a steer

Thanks all
wintermute-obs

Don’t know dataviewjs, but this works in a local vault:

```dataviewjs
dv.taskList(dv.pages().file.tasks 
  .where(t => !t.completed)
  .where(t => t.text.includes("2024-08-26")))
```

Fixed it! Just put the templater command to grab the file title into the speech marks.

dv.taskList(dv.pages().file.tasks 
  .where(t => !t.completed)
  .where(t => t.text.includes("<% tp.file.title %>”)))

so Templater plugin is filling in the date info

Thanks all

1 Like

thanks Hampton found the fix using templeter

1 Like

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