copy date to field with different formatting
Hi there
I am using the following sample code to copy a date from one field to other fields that all have different formatting. The sample codes works and updates the destination fields as expected but when I change it to copying the source field, I get nothing.
----- sample ----
// Get and Format Date
var currDate = new Date();
var strDate = util.printd("dd-mm-yyyy", currDate);
// Display date on pages
this.getField("CurrentDocDate").value = strDate;
The below code which I have tried as a calculated value (on blur and also on focus on the source and/or destination field) is not working as expected as the source date format is dd-mm-yyyy and the destination fields have the following date formatting: "dd/mmm/yyyy", "yyyy/mm/dddd", and "dd/mm/yy"
// Get and Format Date
var currDate = this.getField("BirthDate");
var strDate = util.printd("dd/mmm/yyyy", currDate);
// Display date in Field
this.getField("BirthDate2").value = strDate;
Thanks for your guidance
Satnam
field values all I
