Commit d4c20cc1 by fsn

显示日期的格式化

parent 1de4c998
......@@ -30,6 +30,20 @@ import java.util.Map.Entry;
public class ToolUtil {
/**
* 判断一个对象是否是时间类型
*
* @author stylefeng
* @Date 2017/4/18 12:55
*/
public static String dateType(Object o){
if(o instanceof Date){
return DateUtil.getDay((Date) o);
}else{
return o.toString();
}
}
/**
* 获取异常的具体信息
*
* @author fengshuonan
......
package project.config.web.beetl;
import com.stylefeng.guns.core.beetl.ShiroExt;
import com.stylefeng.guns.core.util.ToolUtil;
import org.beetl.ext.spring.BeetlGroupUtilConfiguration;
public class BeetlConfiguration extends BeetlGroupUtilConfiguration {
......@@ -9,6 +10,7 @@ public class BeetlConfiguration extends BeetlGroupUtilConfiguration {
public void initOther() {
groupTemplate.registerFunctionPackage("shiro", new ShiroExt());
groupTemplate.registerFunctionPackage("tool", new ToolUtil());
}
......
......@@ -11,7 +11,10 @@
<div class="form-group">
<label class="col-sm-3 control-label">${name}</label>
<div class="col-sm-9">
<input class="form-control" id="${id}" value="${value!}"
<input class="form-control" id="${id}"
@if(isNotEmpty(value)){
value="${tool.dateType(value)}"
@}
@if(isNotEmpty(type)){
type="${type}"
@}else{
......
......@@ -23,8 +23,8 @@
<#input id="name" name="姓名" underline="true" value="${user.name}"/>
<#input id="birthday" name="出生日期" underline="true" type="date"
value="${user.birthday,dateFormat="yyyy-MM-dd"}"
clickFun="laydate({istime: false, format: 'YYYY-MM-DD'})"/>
value="${user.birthday}"
clickFun="laydate({istime: false, format: 'YYYY-MM-DD'})" />
<#input id="citySel" name="部门" underline="true" readonly="readonly" hidden="deptid" hiddenValue="${user.deptid}" value="${deptName}"
clickFun="UserInfoDlg.showDeptSelectTree(); return false;"
......
......@@ -32,7 +32,7 @@
<#input id="name" name="姓名" underline="true" value="${user.name}"/>
<#input id="birthday" name="出生日期" underline="true" type="date"
value="${user.birthday,dateFormat="yyyy-MM-dd"}"
value="${user.birthday}"
clickFun="laydate({istime: false, format: 'YYYY-MM-DD'})"/>
<#input id="citySel" name="部门" underline="true" readonly="readonly" value="${deptName}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment