Convert a date to CDISC format (dd/mmm/yyyy) in EDC/CDMS
Study admins can define a custom date format for each institute in the Settings tab.
The calculation template below can be used to convert a date field entry into CDISC format (dd/mmm/yyyy).
For example, if 30-01-2025 is entered into the date field, this calculation will convert the entry into the new format, such as 30/JAN/2025. Replace your_date_variable with the variable name of the date field that should be converted. Test the calculation in the calculation helper tool here.
var date = '{your_date_variable}';
var day = date.substr(0,2);
var month = date.substr(3,2);
var year = date.substr(6,4);
var months = ["JAN", "FEB", "MAR","APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"];
monthInteger = parseInt(month) - 1;
day + "/" + months[monthInteger] + "/" + year;