Timeline: time expressions

Hi,   Currently I am playing around with the Timeline widget. I have created an entity called "Intake_Events" with the following attributes: eventDescription eventType Based on the creation date of an event, the Timeline is showing me data. The data is group per day basis.   How can I set the group header like "Today", "Yesterday" based on the CreationDate? I have tried the following expression if floor(daysBetween([%CurrentDateTime%],$currentObject/createdDate)) = 0 then 'Today' else if floor(daysBetween([%CurrentDateTime%],$currentObject/createdDate)) = 1 then 'Yesterday' else formatDateTime($currentObject/createdDate,'MMMM dd, yyyy') But the daysBetween is based on hours. When I create a new item today at 12:00 PM it still shows today the following date before 12:00 PM.   Thanks!!
2 answers

You could add in the trimToDays function around the dates. This will set the time element to 00:00:00. Also use [%BeginOfCurrentDay%] instead of [%CurrentDateTime%] so you are comparing just the date elements of the current day and your object's createdDate.




I hope this helps.


Fixed by Robert Price with the following expression:

if floor(daysBetween([%BeginOfCurrentDay%],trimToDays($currentObject/createdDate))) = 0 then 'Today'	
else if floor(daysBetween([%BeginOfCurrentDay%],trimToDays($currentObject/createdDate))) = 1 then 'Yesterday'
else formatDateTime($currentObject/createdDate,'MMMM dd, yyyy')