String date to date property in automation/workflow with custom code

I’m trying to do this and I’m struggling with writing the properties still.
I get outputs that look exactly like the format (from what I can tell):

Why are these coming back as invalid for datepicker fields?