Red Gregory

View Original

4 Advanced Date Formulas In Notion To Copy

Grab Date From Title

If you use a database for daily entries, like a journal, and populate each title with a date, this formula allows you to create a date from that title. For it to work properly, the date must have this format: MM-DD-YYYY or MM/DD/YYYY or MM DD YYYY.

Properties required:

  • Name

dateAdd(dateAdd(dateAdd(dateSubtract(dateSubtract(dateSubtract(dateSubtract(dateSubtract(now(), year(now()), "years"), month(now()), "months"), date(now()) - 1, "days"), hour(now()), "hours"), minute(now()), "minutes"), toNumber(slice(prop("Name"), 6, 10)), "years"), toNumber(slice(prop("Name"), 0, 2)) - 1, "months"), toNumber(slice(prop("Name"), 3, 5)) - 1, "days")

Signal Recurring Dates

Create a list of recurring dates in a Notion table and label each with a frequency select option like "Wednesday" or "15th of the month." This formula will signal if that task lands on today. In addition, there is an option to select a recurring yearly date (ie. birthdays and holidays).

Properties required:

  • Frequency: select

  • Date: text

if(prop("Frequency") == "Daily", true, if(contains(prop("Frequency"), "Last Day"), if(date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days")) == date(now()), true, false), if(formatDate(now(), "MMMM D") == prop("Date"), true, if(contains(prop("Frequency"), formatDate(now(), "dddd")), true, if(toNumber(prop("Frequency")) == date(now()), true, false)))))

Push Dates Forward

Especially useful for spaced repetition, this notion formula allows you to add days to a date from multiple select properties. For example, below are three "push" properties to push the start day in three separate occasions, resulting in one updated "next date."

Properties required:

  • Push (multiple): select

  • Start: date

dateAdd(prop("Start"), toNumber(prop("Push 1")) + toNumber(prop("Push 2")) + toNumber(prop("Push 3")), "days")

Add Business Days

Ever wonder how to add business days in Notion? This formulas ensures every date you push forward lands on a weekday between Monday and Friday. This is possible using the day() function. In short, if day lands on a Saturday, push an additional two days, and one day for Sunday.

Properties required:

  • Start: date

  • Push: select

if(day(dateAdd(prop("Start"), toNumber(prop("Push")), "days")) == 6, dateAdd(dateAdd(prop("Start"), toNumber(prop("Push")), "days"), 2, "days"), if(day(dateAdd(prop("Start"), toNumber(prop("Push")), "days")) == 0, dateAdd(dateAdd(prop("Start"), toNumber(prop("Push")), "days"), 1, "days"), dateAdd(prop("Start"), toNumber(prop("Push")), "days")))

See this content in the original post

Further Reading

See this gallery in the original post