Skip to content

Instantly share code, notes, and snippets.

@kaovilai
Last active July 29, 2020 18:10
Show Gist options
  • Save kaovilai/54ef5480bdc8e4cfa19ddb480e74b388 to your computer and use it in GitHub Desktop.
Save kaovilai/54ef5480bdc8e4cfa19ddb480e74b388 to your computer and use it in GitHub Desktop.
Notion formulas
//Age of task
concat(format(dateBetween(prop("Date Created"), now(), "days")), " days old");
//If Due Date is empty, don't display due in
if(empty(prop("Due Date")), "", "Due in " + format(dateBetween(prop("Due Date"), now(), "days")) + " days")
//Combined
concat(format(dateBetween(now(), prop("Date Created"), "days")), " days old") + if(empty(prop("Due Date")), "", "; Due in " + format(dateBetween(prop("Due Date"), now(), "days")) + "D " + format(dateBetween(prop("Due Date"), now(), "hours") - 24 * dateBetween(prop("Due Date"), now(), "days")) + "H " + format(dateBetween(prop("Due Date"), now(), "minutes") - 60 * dateBetween(prop("Due Date"), now(), "hours")) + "M " + format(dateBetween(prop("Due Date"), now(), "seconds") - 60 * dateBetween(prop("Due Date"), now(), "minutes")) + "S") + if(empty(prop("blocked by")), "", "\nBlocked by '" + prop("blocked by") + "'") + if(empty(prop("blocking")), "", "; \nblocking: '" + prop("blocking") + "'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment