Which date picker you are using at your end. Are you using web based or window based application.
I see the date picker shared in screenshot is a field from Pega Platform. I could find a date picker similar to the one you shared and have written a test automation which is working as expected in my environment.
Your Automation design should be as below screenshot:
Hope this helps, Please let us know if you have any queries.
Now i got the Date Picker field in another screen where the JS is not working. Please find attached screenshot (FileName - "Webpage"...The blue highlighted is the date picker field which i interrogated and comes under the webpage "04_ContractProHomeScreen").
Then i pulled the webpage "04_ContractProHomeScreen" into the automation with execute and Invoke method, Pasted your JS code but ended up with an error"HRESULT: 0x80020101 " when i ran the automation.