简体   繁体   中英

How to configure a custom date format for ActiveWeb templates

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM