后台把时间数据返回转换成json然后加载在easyui的datagrid里面显示object求解
这个是返回的json值中的一条记录
{"tc_id":1,"tp_id":1,"tpi_birth":{"date":1,"day":3,"hours":0,"minutes":0,"month":0,"seconds":0,"time":1388505600000,"timezoneOffset":-480,"year":114},"tpi_dormitory":"88-888","tpi_grade":"88","tpi_id":1,"tpi_name":"admin","tpi_password":"admin","tpi_phone":"888888","tpi_realName":"超级管理员","tpi_sex":true}
如何才能把数据返回成yy-MM--dd格式?然后页面显示为yy-MM--dd格式
页面显示[object Object]
想要详细的代码,json和easyui新手,求教
------解决方案--------------------后台list<javabean>转成json时,有个方法,
JsonConfig config = new JsonConfig();
config.setIgnoreDefaultExcludes(false);
config.registerJsonValueProcessor(java.sql.Date.class, new DateJsonValueProcessor("yyyy-MM-dd"));
JSONArray resultArray = JSONArray.fromObject(list,config);
这样设置再转换,sql.Date的日期类型就变成你要的字符串了。