Commit d4c20cc1 by fsn

显示日期的格式化

parent 1de4c998
...@@ -28,6 +28,20 @@ import java.util.Map.Entry; ...@@ -28,6 +28,20 @@ import java.util.Map.Entry;
* 高频方法集合类 * 高频方法集合类
*/ */
public class ToolUtil { 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();
}
}
/** /**
* 获取异常的具体信息 * 获取异常的具体信息
......
package project.config.web.beetl; package project.config.web.beetl;
import com.stylefeng.guns.core.beetl.ShiroExt; import com.stylefeng.guns.core.beetl.ShiroExt;
import com.stylefeng.guns.core.util.ToolUtil;
import org.beetl.ext.spring.BeetlGroupUtilConfiguration; import org.beetl.ext.spring.BeetlGroupUtilConfiguration;
public class BeetlConfiguration extends BeetlGroupUtilConfiguration { public class BeetlConfiguration extends BeetlGroupUtilConfiguration {
...@@ -9,6 +10,7 @@ public class BeetlConfiguration extends BeetlGroupUtilConfiguration { ...@@ -9,6 +10,7 @@ public class BeetlConfiguration extends BeetlGroupUtilConfiguration {
public void initOther() { public void initOther() {
groupTemplate.registerFunctionPackage("shiro", new ShiroExt()); groupTemplate.registerFunctionPackage("shiro", new ShiroExt());
groupTemplate.registerFunctionPackage("tool", new ToolUtil());
} }
......
...@@ -11,7 +11,10 @@ ...@@ -11,7 +11,10 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">${name}</label> <label class="col-sm-3 control-label">${name}</label>
<div class="col-sm-9"> <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)){ @if(isNotEmpty(type)){
type="${type}" type="${type}"
@}else{ @}else{
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
<#input id="name" name="姓名" underline="true" value="${user.name}"/> <#input id="name" name="姓名" underline="true" value="${user.name}"/>
<#input id="birthday" name="出生日期" underline="true" type="date" <#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'})"/> clickFun="laydate({istime: false, format: 'YYYY-MM-DD'})" />
<#input id="citySel" name="部门" underline="true" readonly="readonly" hidden="deptid" hiddenValue="${user.deptid}" value="${deptName}" <#input id="citySel" name="部门" underline="true" readonly="readonly" hidden="deptid" hiddenValue="${user.deptid}" value="${deptName}"
clickFun="UserInfoDlg.showDeptSelectTree(); return false;" clickFun="UserInfoDlg.showDeptSelectTree(); return false;"
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<#input id="name" name="姓名" underline="true" value="${user.name}"/> <#input id="name" name="姓名" underline="true" value="${user.name}"/>
<#input id="birthday" name="出生日期" underline="true" type="date" <#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'})"/> clickFun="laydate({istime: false, format: 'YYYY-MM-DD'})"/>
<#input id="citySel" name="部门" underline="true" readonly="readonly" value="${deptName}" <#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