Notion – Create a date range for current week (Mon-Sun)



This content originally appeared on DEV Community and was authored by Bosco Domingo

To create a dynamic date range in Notion that spans the current week (Mon-Sun) at the time of use, you can use the following formula:

dateRange(dateSubtract({"global":"today","source":"global"}, {"global":"today","source":"global"}.day()-1, "days"), dateAdd({"global":"today","source":"global"}, 7-{"global":"today","source":"global"}.day(), "days"))

What it does is simply to take the current date and find the difference to that week’s Monday (by subtracting days) and to Sunday (by adding days).

To use it, simply chuck it into any formula input (such as in a Button that performs actions, or in Automations).

I personally suggest you create a variable (such as thisWeek) and reference that:

Showcase of the use of the formula for this week

Shameless plug: this comes from my Weekly Learning page, where I write about what I learn as I go. It’s how I create new pages without having to manually set the weekly range. Quite convenient!


This content originally appeared on DEV Community and was authored by Bosco Domingo