浏览代码

完善注释

James 5 年之前
父节点
当前提交
b6dbb717e8
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      src/main/java/com/jfinal/template/ext/directive/NowDirective.java

+ 10 - 2
src/main/java/com/jfinal/template/ext/directive/NowDirective.java

@@ -26,8 +26,16 @@ import com.jfinal.template.stat.ParseException;
 import com.jfinal.template.stat.Scope;
 import com.jfinal.template.stat.Scope;
 
 
 /**
 /**
- * 输出当前时间,默认考虑是输出时间,给 pattern 输出可能是 Date、DateTime、Timestamp
- * 带 String 参数,表示 pattern
+ * 根据 datePattern 参数输出当前时间,未指定 datePattern 参数时默认使用以下配置
+ * env.getEngineConfig().getDatePattern()
+ * 
+ * 注意该指令需要配置才能使用:
+ * engine.addDirective("now", NowDirective.class, true);
+ * 
+ * 例子:
+ * 1:#now()
+ * 2:#now("HH:mm:ss")
+ * 3:#now("yyyy-MM-dd HH:mm:ss")
  */
  */
 public class NowDirective extends Directive {
 public class NowDirective extends Directive {