In a Lightning (jquery) detail form I have a datepicker defined with this script:
<script type="text/javascript">
$( '#\\.Ltg_CPAgreementSigDate_d' ).datepicker({
changeMonth: false,
changeYear: false,
yearRange: "-0:+0",
dateFormat: "mm/dd/yy",
});
</script>
When a user clicks the OK button in the form, 4D code does some data validation checks on all of the entry fields and if there are any errors returns a message via Ltg_JS_Send. This works fine, except that the display of the above date gets scrambled. If the user selected 06/23/2021, after the error message is sent it changes to 11/06/2022.
Any suggestions for fixing this?