How to configure a custom date format for ActiveWeb templates

29 views Asked by At

The views docs have an example of number format configuration:

public class FreeMarkerConfig extends AbstractFreeMarkerConfig {
    @Override
    public void init() {
        //this is to override a strange FreeMarker default processing of numbers
        getConfiguration().setNumberFormat("0.##");
     }
}

What is the right syntax to use for a custom date, time format in the below code:

getConfiguration().setDateFormat("what comes here ?????");

Thank you.

1

There are 1 answers

2
ipolevoy On

The method getConfiguration() simply returns an instance of freemarker.template.Configuration, which gives you a direct access to configure FreeMarker any way you want. Please, refer to FreeMarker Configuration docs to see what is possible.