Format date fields in Xporter

How can I format a date/time field in the Xporter plugin template?

For example, in my Word doc I have the field ${CreatedTime} which displays as 2012-10-15 12:48:51.853

I would like to be able to format the date so that it is displayed as October 15, 2012.

2 answers

1 accepted

This widget could not be displayed.

Hi winbolton,

You can use javascript processing instructions for that.

Example:

%{var months = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); var dateParts = '${CreatedTime}'.split('-'); var month = dateParts[1]; var year = dateParts[0] ; var day = dateParts[2].split(' ')[0]; months[parseInt(month) - 1] + ' ' + day + ', ' + year;}

Check the attached template.

This widget could not be displayed.

Hi,

this would also be interesting for me.

I used the field ${CreatedDate} within a Xporter plugin and get e.g. the output

26-06-2013.

In the issue`s detail view, instead, i see

26. Jun 2013 (german date format).

Could you tell me how i apply this german date format onto the Xporter field ${CreatedDate} ?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

536 views 3 19
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you