<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" width="40px" /> This example database takes a date from the Date property and returns both the first and last day of the month that contains that date.

Created by Thomas Frank | Learn Notion Formulas | Notion Basics | Templates | Twitter

</aside>

First and Last Day of the Month

“First Day of Month” Property

// Compressed
dateSubtract(prop("Date"), date(prop("Date")) - 1, "days")

// Expanded
dateSubtract(
    prop("Date"),
    date(
        prop("Date")
    ) - 1,
    "days"
)

“Last Day of Month” Property

// Compressed
dateSubtract(dateAdd(prop("Date"), 1, "months"), date(prop("Date")), "days")

// Expanded
dateSubtract(
    dateAdd(
        prop("Date"),
        1,
        "months"
    ),
    date(
        prop("Date")
    ),
    "days"
)

© Thomas Frank