🔑 Match Date In Title
For those using a Notion database for daily journaling or something similar, it may be beneficial to use dates as the title of a page. The formulas below show you how to match titles/text properties to dates like finding a current year, current date, tomorrow’s date, and more. Included are formulas that can return the equivalent solution for a date property too.
Date Format Reference
Type | Format | Result |
---|---|---|
Month | M | 1-12 |
Month | Mo | 1st-12th |
Month | MM | 01-12 |
Month | MMM | Jan-Dec |
Month | MMMM | January-December |
Week | W | 1-52 (start Monday) |
Week | w | 1-52 (start Sunday) |
Day | D | 1-31 |
Day | Do | 1st-31st |
Day | DD | 01-31 |
Day | DDD | 1-365 |
Weekday | d | 0-6 |
Weekday | dd | Su-Sa |
Weekday | ddd | Sun-Sat |
Weekday | dddd | Sunday-Saturday |
Year | Y | 2021 |
Year | YY | 21 |
Time | h | 1-12 |
Time | hh | 01-12 |
Time | H | 0-23 |
Time | m | 0-59 |
Time | mm | 00-59 |
Full Time | h:mm a | 8:43 am |
Full Time | h:mm A | 8:43 AM |
Full Date | L | 8/11/2021 |
Full Date | LL | August 11, 2021 |
Full Date | LLL | August 11, 2021 8:43 AM |
Full Date | LLLL | Thursday, August 11, 2021 8:43 AM |
Formulas are made for the example above. Formatting styles should be changed according to the date style of your text. Refer to reference table for more date formatting options.
1. Match Current Year To Date
contains(prop("Name"), format(year(now())))
Date Property Equivalent
year(now()) == year(prop("Date"))
2. Date Matches Today
formatDate(now(), "MMMM Do YYYY") == prop("Name")
Date Property Equivalent
formatDate(now(), "LL") == formatDate(prop(“Date”), "LL")
3. Date Matches Tomorrow
formatDate(dateAdd(now(), 1, "days"), "MMMM Do YYYY") == prop("Name")
Date Property Equivalent
formatDate(dateAdd(now(), 1, "days"), "LL") == prop(“Date”)
4. Date Matches This Month and Year
contains(prop("Name"), formatDate(now(), "MMMM")) and contains(prop("Name"), formatDate(now(), "YYYY"))
Date Property Equivalent
formatDate(now(), "M Y")) == formatDate(prop(“Date”), "M Y"))