The dateRange()
function returns a date range constructed from two date objects (a start and end date).
dateRange(startDate, endDate)
startDate.dateRange(endDate)
Code language: JavaScript (javascript)
This formula can be used to create pages that span multiple dates in a calendar view of a database. If you’ve connected a database to Notion Calendar, you can also use it to contruct an event with a duration greater than the default value.
Example Formula
dateRange(parseDate("2023"), parseDate("2023-02"))
/* Output: @January 1, 2023 → @February 1, 2023 */
Code language: JavaScript (javascript)