Progress
if(empty(prop("Course Dates")), "", if(formatDate(now(), "L") == formatDate(start(prop("Course Dates")), "L"), "😬 This course starts today!", if(formatDate(now(), "L") == formatDate(end(prop("Course Dates")), "L"), "🎉 This course ends today!", if(now() < start(prop("Course Dates")), "⏰ " + format(ceil(dateBetween(start(prop("Course Dates")), now(), "hours") / 24)) + " days until course starts", if(now() > end(prop("Course Dates")), "💀 " + format(dateBetween(now(), end(prop("Course Dates")), "days")) + " days since course ended", "⏳ " + format(ceil(dateBetween(end(prop("Course Dates")), now(), "hours") / 24)) + " days left of course • " + format(round(100 - dateBetween(end(prop("Course Dates")), now(), "hours") / 24 / (dateBetween(end(prop("Course Dates")), start(prop("Course Dates")), "hours") / 24) * 100)) + "% done")))))
Explanation
if(empty(prop("Course Dates")), "",
If Course Dates is empty, display nothing.
if(formatDate(now(), "L") == formatDate(start(prop("Course Dates")), "L"), "😬 This course starts today!",
Otherwise if the current date in MM/DD/YYYY format matches that of the start date of Course Dates, display 😬 This course starts today!
if(formatDate(now(), "L") == formatDate(end(prop("Course Dates")), "L"), "🎉 This course ends today!",
Otherwise if the current date in MM/DD/YYYY format matches that of the end date of Course Dates, display 🎉 This course ends today!
if(now() < start(prop("Course Dates")), "⏰ " + format(ceil(dateBetween(start(prop("Course Dates")), now(), "hours") / 24)) + " days until course starts",
Otherwise if the current date is less that the start date of Course Dates, display ⏰ # days until course starts.
if(now() > end(prop("Course Dates")), "💀 " + format(dateBetween(now(), end(prop("Course Dates")), "days")) + " days since course ended",
Otherwise if the current date is greater than the end date of Course Dates, display 💀 # days since course ended.
"⏳ " + format(ceil(dateBetween(end(prop("Course Dates")), now(), "hours") / 24)) + " days left of course • " + format(round(100 - dateBetween(end(prop("Course Dates")), now(), "hours") / 24 / (dateBetween(end(prop("Course Dates")), start(prop("Course Dates")), "hours") / 24) * 100)) + "% done")))))
Otherwise display ⏳ # days left of course • #% done