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
Community moderators have prevented the ability to post new answers.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.