Create a D-Day Counter | Notion Ideas You Haven’t Thought Of Pt.2

post type
created time
2024/03/14 09:04
This blog post provides a tutorial on creating a D-Day counter using Notion. The tutorial aims to help users utilize the style() formula introduced in the Notion 3.0 update.
2 more properties
Hey guys, welcome to my blog!
This is the part two of the tutorial series titled “Notion Idea You Haven’t Thought Of”! The title originates from the release of the 3.0 Notion update, which introduced a new formula called style(). I noticed a lack of tutorials on how to incorporate this into the workspace. So, I thought I’d share three ideas on how you can utilize this.
Without further ado, let’s get started.
code index code Database Database property Name of the property Database view Menu Options

disclaimer & prerequisites

For this tutorial, you need Notion 3.0. You can download it using the link provided below or on my website. I also have a selection of pre-made templates made with love available for purchase, so do check them out. Note that we will be using Formula quite often throughout.

step 1: create a new inline database

The first thing you want to do is open up a new or in my case existing page, where you want to add the d-day counter. The type slash database to create a new inline database.

step 2: change to gallery view

Now that’s done, click ••• Layout → Gallery.
Set Card preview to None and set Card size to Small.

step 3: add date and formula properties

Now, remove all the default entries, leaving only one. Click on the remaining entry and here we are going to add three new properties.
Click on the card to open it up as a page. Then click on + Add a property.
date - Date property
calculateDate - Formula property
display - Formula property

step 4: Create a calculateDate formula

dateBetween(prop("date"), now(), "days")
Notion Formula
Click on calculateDate field and we are going to add the formula that calculates the date inbetween current date and the date of the event.
Type in the following:
The dateBetween() formula in Notion calculates the number of days between two dates. now() refers to the current date.
Therefore, dateBetween(prop("date"), now(), "days") calculates the number of days between the date set in date and current date.

step 5: create a display formula

Next, click on the display field. We will create a display for the D-Day Counter. This formula, if the event date has passed, will show the number of days passed in red. If it's D-Day, it will be purple. If there are days remaining, it will be green.
Type in the following
let(day, format(prop("calculateDate")), ifs(prop("calculateDate") < 0, style(day + " days passed", "red", "red_background"), prop("calculateDate") == 0, style("it's d-day", "purple", "purple_background"), style(day + " days left!", "green", "green_background")))
Notion Formula
Here's a breakdown of the formula:
let(day, format(prop("calculateDate")) : This part of the formula creates a variable called 'day' and assigns it the value of the calculateDate formatted as a string. In another word, the number value calculateDate is converted into a string (text) and stored in a variable called day.
ifs(prop("calculateDate") < 0, style(day + " days passed", "red", "red_background") : This checks if calculateDate is less than 0, which means the event date has passed. If true, it displays the number of days that have passed since the event date in red text on a red background.
prop("calculateDate") == 0, style("it's d-day", "purple", "purple_background") : This checks if calculateDate is equal to 0, which means it's the event date (D-Day). If it's true, it displays "it's d-day" in purple text on a purple background.
style(day + " days left!", "green", "green_background")) : If neither of the above conditions are true, it means the event date is in the future. The formula will then display the number of days left until the event, in green text on a green background.
Now you can test it out by changing the date in the date property and see if works as intented.

step 6: show properties on the card

If your card appears different, it's possible that some properties are hidden. If that’s your case, go to timeline view. Click ••• PropertiesHide all Properties. Then, show display, Formula property
Feel free to create more d-days or event and now you are all set!


Thank you for reading this tutorial! If you found it helpful, be sure to check out shop for my beautiful templates, which I am confident enough to say are a game-changer Subscribe to my newsletter and feel free to follow me on my social media for updates!
Happy Notion(ing)!