Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can i change date style in releasenotes template?

Maximilian Neis January 24, 2016

Hello community,

 

I want to configure our releasenotes template so that I get a SQL Statement for each issue (The releasenotes are published in a table on our homepage)

 

So far so good.

 

I'm struggling though, because the versionObj.ReleaseDate returns a Timestamp (Date and Time) and the time is always 00.00.00.0, so I want to change it to an date only format. According to this page:

https://thepluginpeople.atlassian.net/wiki/display/JEMH/Work+with+Dates+in+velocity+templates

the method that should work for me is $dateFormatter.withStyle($dateTimeStyle.DATE).format($versionObj.ReleaseDate).

I also tried it with dateTimeFormatter which is the actual class in JIRA 6.4.11 (that I'm using), but as you can guess both doesn't work for me. It seems that dateTimeFormatter and dateFormatter both doesn't work at all for the releasenotes template as I can't find any methods that work.

So my question is can you find me a method that works? I'm really desperate as I lost waay too much time on that.

 

Thanks in advance

 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Maximilian Neis January 29, 2016

If someone ever wonder about the same problem, here's the solution:

#set( $DateString = '' )##

$DateString.format('%1$tY-%1$tm-%1$td', $versionObj.releaseDate)

 

It uses the formatter class provided by oracle as you can see here

https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html

 

TAGS
AUG Leaders

Atlassian Community Events