freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoffrey De Smet (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FREEMARKER-35) Official JSR 310 support
Date Sun, 15 Jan 2017 12:28:26 GMT

    [ https://issues.apache.org/jira/browse/FREEMARKER-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15823115#comment-15823115
] 

Geoffrey De Smet commented on FREEMARKER-35:
--------------------------------------------

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)

Mime
View raw message