Xporter - a mistake on Confluence "Javascript" page Edited

Good day everyone!

Found out that the https://confluence.xpand-addons.com/display/public/XPORTER/Javascript :

%{var months =  new Array( 'Jan' ,  'Feb' ,  'Mar' ,  'Apr' ,  'May' ,  'Jun' ,  'Jul' ,  'Aug' ,  'Sep' ,  'Oct' ,  'Nov' ,  'Dec' ); var dateParts
 = '${dateformat("d-MMM-yyyy HH:mm:ss}'.split( '-' ); var month = dateParts[ 1 ]; var year = dateParts[ 0 ] ; var day = dateParts[ 2 ].split( ' ' )[ 0 ];
 months[Number(month) -  1 ] +  ' ' + day +  ', ' + year;}

doesn't work on the Word templates. Can anyone help to create the correct Javascript for this case? Unfortunately I can't use the standart date-format (MMM) because I need the Rus names of months using the English JIRA version 

Thanks in advance! 

1 answer

1 accepted

ok, the solution was found:

%{var months = new Array('января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'); var dateParts = '${CreatedTime}'.split('-'); var month = dateParts[1]; var day = dateParts[0] ; var year = dateParts[2].split(' ')[0]; '«' + day + '» ' +  months[parseInt(month) - 1]  + ' ' + year + ' г.';}

it would be great to correct the mistake in the documentation.

Have a nice day!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

327 views 0 6
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