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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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} ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.