[
https://issues.apache.org/jira/browse/FREEMARKER-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15823115#comment-15823115
]
Geoffrey De Smet edited comment on FREEMARKER-35 at 1/15/17 12:28 PM:
----------------------------------------------------------------------
So, I switched to Java 8 and replaced java.util.Date by the far more reasonable
java.time alternatives.
Before, my ftl looked like this:
{code}
<tr>
<th>Starting timestamp</th>
<td>${(benchmarkReport.plannerBenchmarkResult.startingTimestamp?datetime?string.medium)!"Differs"}</td>
</tr>
{code}
Now it looks like this:
{code}
<tr>
<th>Starting timestamp</th>
<td>${(benchmarkReport.plannerBenchmarkResult.startingTimestamp.format(java.time.format.DateTimeFormatter.ofLocalizedDate(java.time.format.FormatStyle.MEDIUM)))!"Differs"}</td>
</tr>
{code}
Oh, the horror. I hope Freemarker supports java.time soon!
was (Author: ge0ffrey):
So, I switched to Java 8 and replaced java.util.Date by the far more reasonable
java.time alternatives.
Before, my ftl looked like this:
{code}
<tr>
<th>Starting timestamp</th>
<td>${(benchmarkReport.plannerBenchmarkResult.startingTimestamp?datetime?string.medium)!"Differs"}</td>
</tr>
{code}
Now it looks like this:
{code}
<tr>
<th>Starting timestamp</th>
<td>${(benchmarkReport.plannerBenchmarkResult.startingTimestamp.format(java.time.format.DateTimeFormatter.ofLocalizedDate(java.time.format.FormatStyle.MEDIUM)))!"Differs"}</td>
</tr>
{code}
Oh, the horror. I hope Freemarker supports java.time soon!
> Official JSR 310 support
> ------------------------
>
> Key: FREEMARKER-35
> URL: https://issues.apache.org/jira/browse/FREEMARKER-35
> Project: Apache Freemarker
> Issue Type: Improvement
> Components: engine
> Reporter: Tokuhiro Matsuno
> Priority: Minor
>
> I suggest to implement an official JSR 310 support on freemarker.
> I know there's amedia's great freemarker-java-8.
> But if there's an official support, user can use freemarker more easily.
> ref. https://github.com/amedia/freemarker-java-8
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)