I have created a Date picker custom field ( cf2) which return cf2 = cf1 + 1 Day,
where cf1 is an existing customfield.
Is there anyone can help me remove the Times tamp on my return. Currently cf2 is showing as " MM/dd/yyyy hh:mm a " and i will like to get " MM/dd/yyyy " this format instead.
I am not good in Groovy nor Java, but here's a glance of my code below.
It's working, but i just need help to remove the time stamp w/o going to the Look and Field in Admin and change the Date/Time Formats.
def componentManager = ComponentManager.getInstance()
def customFieldManager = componentManager.getCustomFieldManager()
CustomField field1 = customFieldManager.getCustomFieldObject(new Long(XXXXX)); //Initial field cf1
CustomField resultField = customFieldManager.getCustomFieldObject(new Long(YYYY)); //NEW FIELD cf2
def field1value = issue.getCustomFieldValue(field1);
if (field1value != null )
//Calendar cal = Calendar.getInstance();
//cal.add(Calendar.DATE,1);//add 1 day
//DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
//formatter = new SimpleDateFormat("MM/dd/yyyy");
//result = df.format(field1value + 1).toString();
//result = format1.format(cal.getTime());
result = field1value + 1 ;
result = null;