I have a drop-down list and the date field next to it. As soon as entry selected from drop-down list (I use "change" event) I populate the date field "SupervisorDate" with the current date using the following line of code:
SupervisorSigContent.SupervisorDate.rawValue = num2date(date(), "MM/DD/YYYY")
The "SupervisorDate" date field however has custom validation script defined to verify the date. Also it has the following settings: edit pattern - date{MM/DD/YYYY} and display pattern - date{EEE, MMM D, YYYY} which is done to make it inline with all other date fields in the form.
The problem is that after selecting item from the drop down list the date field is successfully populated with the current date in the following format: "MM/DD/YYYY"
but all other date fields display date like "Mon, Feb 5, 2011". I tried to use
SupervisorSigContent.SupervisorDate.rawValue = num2date(date(), "EEE, MMM D, YYYY")
but in this case my date validation script fails and returns "false"
Please help to understand what I am doing wrong and how to overcome this issue.
Appreciate any help.