How to list the number of notes created in different periods of time?

What I’m trying to do

I need a very simple view to keep track of the number of notes created in a specific folder in different periods of time (today, this week, this month, this year). I only need the number of notes, not a list of them. All my notes contain creation date and time info in the metadata’s “created” field, using this format “2026-01-03-22:21”.

Things I have tried

I have managed to get a list of notes created during a period of time using Dataview:

dataview
LIST
FROM "Folder"
WHERE file.mtime >= date(today) - dur(1 week)
SORT file.mtime ASC

But I do not need a list of notes. I only need to know the number of notes. Ideally, the output would be as simple as this:

Notes created
Today: 4
This Week: 16
This Month: 65

Thanks for your help!

Your approach has two issues: file.mtime captures the modification date rather than your custom created field, and LIST inherently produces an enumeration, not an aggregation. For the compact single-line output you’re after, DataviewJS is the cleanest solution since standard Dataview queries can’t combine multiple counts inline.

There’s also a parsing problem: your date format 2026-01-03-22:21 isn’t ISO-compliant (the hyphen before the time), so Dataview won’t automatically recognize it as a date. It needs manual conversion:

const folder = "Folder";
const pages = dv.pages(`"${folder}"`).where(p => p.created);

function parseCreated(str) {
    const match = str.match(/^(\d{4}-\d{2}-\d{2})-(\d{2}:\d{2})$/);
    return match ? dv.date(match[1] + "T" + match[2]) : null;
}

const now = dv.date("today");
const startOfWeek = now.minus({ days: now.weekday - 1 });
const startOfMonth = dv.date(now.toFormat("yyyy-MM") + "-01");
const startOfYear = dv.date(now.year + "-01-01");

function countSince(start) {
    return pages.filter(p => {
        const d = parseCreated(p.created);
        return d && d >= start;
    }).length;
}

const today = countSince(now);
const week = countSince(startOfWeek);
const month = countSince(startOfMonth);
const year = countSince(startOfYear);

dv.paragraph(`**Notes created** — Today: ${today} · This Week: ${week} · This Month: ${month} · This Year: ${year}`);

The parseCreated function transforms your format into ISO (2026-01-03T22:21), which Luxon—the date library behind Dataview—understands. Week calculation uses Monday as the first day (ISO standard); if you prefer Sunday, replace now.weekday - 1 with now.weekday % 7.

Have a great day!

1 Like

Wonderful, it works!

To simplify things in the future, what would be an ISO-compliant date format? Obisdian’s default yyyy-MM-dd'T'HH:mm? And is there an easy way to bulk-convert the dates in all my notes to that format?