var x=$CS.getValue("SCHEDULEDSTARTTIME");
if ( x === undefined)
{
$CS.setValue("SCHEDULEDSTARTTIME",new Date());
}
x=$CS.getValue("SCHEDULEDSTARTTIME");
$CS.setValue("SCHEDULEDENDTIME",x);
/* set days and hours from the current date*/
/* Date Field */
var fieldName='SCHEDULEDENDTIME';
/* you can choose the value 0 to 27 days*/
var nextDay=7;
/* you can choose the value 0 to 23 hours*/
var nextHour=0;
$CS.setDateFromCurrentDate(fieldName,nextDay,nextHour);