0

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.

ipolevoy
  • 5,432
  • 2
  • 31
  • 46
belgoros
  • 3,590
  • 7
  • 38
  • 76

1 Answers1

1

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.

ipolevoy
  • 5,432
  • 2
  • 31
  • 46
  • Cool, thank you ! I didn't find their API docs. Now I know where it s hidden :) – belgoros Sep 21 '18 at 20:36
  • Yeah, it is [here](https://freemarker.apache.org/docs/api/freemarker/core/Configurable.html#setDateTimeFormat-java.lang.String-) to be more precise :) – belgoros Sep 24 '18 at 07:14