EasyUI DateBox往后台传值

2018/03/06 14:31
阅读数 26

SpringMVC+Spring+Mybatis

JSP页面:

1 <div>
2             开始日期:<input id="intime" class="easyui-datebox" name="intime"/> - 结束日期:<input id="outtime" class="easyui-datebox" name="outputtime"/>
3             关键字:<input id="keyword" type="text" name="keyword"/>
4             <a id="empSearch" class="easyui-linkbutton" iconCls="icon-search" onclick="empSearch()">Search</a>
5             <a class="easyui-linkbutton" iconCls="icon-redo" onclick="searchReset()">Reset</a>
6         </div>

 

实体模型:

package com.ihad.crm.query;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

public class EmployeeQueryObject extends QueryObject {
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date intime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date outtime;
    private String keyword;

    public Date getIntime() {
        return intime;
    }
    
    public void setIntime(Date intime) {
        this.intime = intime;
    }

    public Date getOuttime() {
        return outtime;
    }

    public void setOuttime(Date outtime) {
        this.outtime = outtime;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    @Override
    public String toString() {
        return "EmployeeQueryObject [intime=" + intime + ", outtime=" + outtime + ", keyword=" + keyword + "]";
    }
}

 

 使用注解@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT-8")将jsp页面传到后台的日期格式化为想要的格式

 

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部