
I am getting all historical values of due date and putting a strikethrough of all past due dates except the latest one.
e.g. for myArray = None -> 2025-04-11 00:00:00.0,
2025-04-11 00:00:00.0 -> 2025-04-25 00:00:00.0,
2025-04-25 00:00:00.0 -> 2025-06-30 00:00:00.0
The output is:

However, this formula fails for this myArray and I am unable to debug why that is the case. (Someone is setting and unsetting the value of 5/15/2025..)
myArray = None -> 2025-05-15 00:00:00.0,
2025-05-15 00:00:00.0 -> None,
None -> 2025-05-15 00:00:00.0
The output I get is 
Here is the code..
WITH myArray = unique( history ) :
// WITH myArray = history.changes.filter($.field = "duedate") :
WITH formattedArray = MAP(myArray,
IF(
$.to = LAST(myArray).to,
$.to,
CONCAT("~~ ", $.to, " ~~")
)
) :
//myArray
//formattedArray
JOIN(formattedArray, ", ", "", "")
Can anyone explain what is going on?