Hi everyone,
Hoping someone can help me. I have a script running that pulls information from the request details and adds them into the subject for my new starter request. The issue is, one of the fields i am pulling is a custom field for the employees start date, however when this pulls through it comes through as below:
EMPLOYEE NAME: Daniel Walker START DATE: Mon May 27 2019 16:02:00 GMT+0100 (British Summer Time) DEPARTMENT: Service Desk
The highlighted area is showing the full time and timezone but i just want the date and want it look like below:
EMPLOYEE NAME: Daniel Walker START DATE: 27/05/2019 DEPARTMENT: Service Desk
Does anyone know if this is possible within the script to amend the date format? The script i am using is below:
Thanks all.
- if($CS.isFormSubmit())
- {
- var employee=$CS.getValue("ServiceReq_User_UDF_CHAR1");
- var startdate=$CS.getValue("ServiceReq_User_UDF_DATE1");
- var dept=$CS.getValue("ServiceReq_User_UDF_CHAR2");
- var subject = $CS.getValue("SUBJECT");
- subject = "EMPLOYEE NAME: " + employee + " START DATE: " + startdate + " DEPARTMENT: " + dept;
- $CS.setValue("SUBJECT", subject);
- }