Entries

Duration

!prop("Date") or prop("Date").dateStart() == prop("Date").dateEnd() 
	? "" 
	: floor(
			dateBetween(
				dateEnd(prop("Date")), 
				dateStart(prop("Date")), 
				"minutes"
			) / 60
		)
	+ "h " 
	+ dateBetween(
			dateEnd(prop("Date")), 
			dateStart(prop("Date")), 
			"minutes"
		) % 60
	+ "m"

if(empty(prop("Date")) or start(prop("Date")) == end(prop("Date")),

Check to see if Date is empty or the start date and time of Date is the same as the end date and time of Date (meaning there's no range).

"",

If either of the about return true, display nothing. Otherwise do the following.

format(floor(dateBetween(end(prop("Date")), start(prop("Date")), "minutes") / 60)) + "h "

Calculate the number of minutes between the start date and time of Date and the end date and time of Date, divide by 60 to get the hours as a decimal, round it down, then add h.

format(floor(dateBetween(end(prop("Date")), start(prop("Date")), "minutes") % 60)) + "m")

Calculate the number of minutes between the start date and time of Date and the end date and time of Date, divide by 60 and return the remainder with %, then add m.

<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1649d2f9-1b45-478a-86b4-341fbe27e06f/benny.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1649d2f9-1b45-478a-86b4-341fbe27e06f/benny.png" width="40px" /> By BenLatest • Was this helpful? Please consider buying me a coffee. Cheers!

</aside>