Back to Home

DataviewJS and Meta Bind for Obsidian tasks by date

Article describes the implementation of an interactive page in Obsidian for viewing tasks on a selected date using Meta Bind and DataviewJS. Code breakdown, plugin installation and usage nuances. Suitable for middle/senior developers using Obsidian.

Dynamic Obsidian tasks: date by click with Meta Bind
Advertisement 728x90

Interactive Obsidian Task View by Selected Date with Meta Bind and DataviewJS

Meta Bind and DataviewJS enable creating a page with an interactive date picker for viewing tasks. In reading mode, users click a calendar, select a date—and the list updates automatically. This solution uses YAML properties as an intermediate storage between the input widget and output script.

This eliminates manual editing of Tasks or Dataview queries, where the date needs to be changed in the code each time.

Setup: Install Plugins and YAML Block

Install the Meta Bind and Dataview plugins via Obsidian settings. In Dataview, enable JavaScript Queries.

Google AdInline article slot

Create a file, e.g., DynamicTasks.md, with a YAML block:

---
selected-date: 2025-12-30
---

The initial value will be overwritten by the widget.

Meta Bind Widget for Date Selection

Below the YAML, insert:

Google AdInline article slot

INPUT[datePicker: selected-date]

In reading mode, a calendar appears. Clicking opens a date picker, and the value is saved to selected-date.

DataviewJS Script: Filtering and Rendering Tasks

After the widget, add a script to search for tasks:

Google AdInline article slot

const targetDate = dv.current().file.frontmatter["selected-date"];

const pages = dv.pages('"Work"')

.where(p => p.file.tasks

.where(t => !t.completed && t.due && t.due.toISODate() === targetDate)

.length > 0);

for (let page of pages) {

dv.el("div", dv.fileLink(page.file.path, false), {

attr: {

style: "display:inline-block; margin:8px 0 4px 0; padding:3px 8px; border-radius:6px; background:#e0f0ff; color:#0366d6; font-weight:500;"

}

});

dv.taskList(

page.file.tasks

.where(t => !t.completed && t.due && t.due.toISODate() === targetDate),

false

);

}

Script Breakdown

  • Reading the date: dv.current().file.frontmatter["selected-date"] returns a string YYYY-MM-DD.
  • Searching files: dv.pages('"Work"') scans the folder. The filter checks for incomplete tasks with due on targetDate via .toISODate().
  • Rendering: For each file—a badge link with CSS styling and dv.taskList without grouping (false). Replace "Work" with your folder.

Integration into a Canvas Dashboard

Drag the file onto a Canvas—Obsidian creates an interactive card. Adjust the size. Work directly on the dashboard or click to navigate.

Requirements and Features

  • Tasks syntax: Use the emoji 📅 YYYY-MM-DD for due. Regular checkboxes without dates are ignored.
  • Updates: DataviewJS restarts with a delay of ~1 second after changing the date.

Key Points

  • Meta Bind's interactive datePicker updates YAML without manual editing.
  • DataviewJS filters tasks by exact match due.toISODate() === targetDate.
  • Grouping by files with custom badges for UI control.
  • Automatic rendering in Canvas without additional plugins.
  • Suitable for checking workload on future dates (vacation, meetings).

Advantages Over Static Queries

| Approach | Changing Date | Reading Mode | Auto-Update |

|----------|---------------|--------------|-------------|

| Tasks due on DATE | Manual in code | No | No |

| Dataview due = date() | Manual in code | No | No |

| YAML + Meta Bind + DataviewJS | Click-calendar | Yes | Yes |

The solution is scalable: add filters for tags or statuses in .where().

— Editorial Team

Advertisement 728x90

Read Next