簡體   English   中英

如何為ActiveWeb模板配置自定義日期格式

[英]How to configure a custom date format for ActiveWeb templates

視圖文檔有一個數字格式配置示例:

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

以下代碼中用於自定義日期,時間格式的正確語法是什么:

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

謝謝。

方法getConfiguration()只是返回freemarker.template.Configuration的實例,它使您可以直接訪問所需的任何方式來配置FreeMarker。 請參考FreeMarker配置文檔以了解可能的情況。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM