DateTime documentation - I cannot convert it to string and compare to today. In debugger console I understand that I have a DateTime variable, but I cannot find its documentation and understand how to exctract the date from it (i want to display tasks completed today. I can't convert them to ISO string.
DQL
// Get today's date in the format YYYY-MM-DD
const today = new Date().toISOString().split("T")[0];
// Initialize a counter for tasks completed today
let completedTaskCount = 0;
// Loop through all tasks in your vault
dv.pages().file.tasks.where(t =>
t.completed)
.forEach(t => {completedTaskCount++;
console.log(t.completion.toISOString());});
// Output the count of tasks completed today
dv.paragraph(`**Tasks completed today:** ${completedTaskCount}`);
What happened?
DateTime documentation - I cannot convert it to string and compare to today. In debugger console I understand that I have a DateTime variable, but I cannot find its documentation and understand how to exctract the date from it (i want to display tasks completed today. I can't convert them to ISO string.
DQL
JS
No response
Dataview Version
latest
Obsidian Version
latest
OS
Linux