Notion Answers

Help between Notion users


Register & Ask

It's free & easy

Get answers

Answers, votes & comments

Vote and select answers

Receive points, vote and give the solution

Question

1vote

Countdown (Years, Months, Weeks, Days, Hours, and Minutes)

Someone help me with a code to countdown Years, Months, Weeks, Days, Hours and Minutes in a single formula property and a single date property (using the ranges as well)

1 Answer

1vote

polle Points77480

You can use a Notion formula like this:

format(dateBetween(prop("Date"), now(), "years")) + "y " + format(dateBetween(prop("Date"), now(), "months")) + "m " + format(dateBetween(prop("Date"), now(), "days")) + "d " + format(dateBetween(prop("Date"), now(), "hours") % 24) + "h " + format(dateBetween(prop("Date"), now(), "minutes") % 60) + "m"

Use Date for your Notion property name and it will work as you need.

1vote

Elpepe commented

Do you think this formula is right? I based on yours

if(empty(prop("Date")), "", replace(format(dateBetween(end(prop("Date")), now(), "years")) + " y ┃ ", "^0 y ┃ ", "") + replace(format(dateBetween(end(prop("Date")), now(), "months") % 12) + " m ┃ ", "^0 m ┃ ", "") + replace(format(round(dateBetween(end(prop("Date")), now(), "weeks") % 4.3452381)) + " w ┃ ", "^0 w ┃ ", "") + replace(format(dateBetween(end(prop("Date")), now(), "days") % 7) + " d ┃ ", "^0 d ┃ ", "") + replace(format(dateBetween(end(prop("Date")), now(), "hours") % 24) + " h ┃ ", "^0 h ┃ ", "") + replace(format(dateBetween(end(prop("Date")), now(), "minutes") % 60) + " min", "^0 min", ""))

1vote

polle commented

Sure thing, removing empty and showing it differently is ok if it does the job. :)

If you believe my answer is the solution, please select it to mark the question as solved.

Please log in or register to answer this question.

...

Welcome to Notion Answers, where you can ask questions and receive answers from other members of the community.

Please share to grow the Notion Community!

Connect