ITeye博客

ext 时间显示小问题,麻烦大家了!!

cleverbing · 2009-03-10 14:48 · Markdown

我 做个Ext.grid.EditorGridPanel练习,但是我的时间显示就是有问题,都显示成这样了: NaN-NaN-NaN了,但是用鼠标点击后就会显示正常了(2009-03-10)了

我的代码片段如下: 列定义: { header: "日期", dataIndex: 'availDate', width: 95, renderer: Ext.util.Format.dateRenderer('Y-m-d'),
editor: new fm.DateField({ format: 'Y-m-d', minValue: '01/01/06', disabledDays: , disabledDaysText: 'Plants are not available on the weekends' }) } 我从后台传来的日期类型是String形式的。 代码片段:(后台处理) SimpleDateFormat dataFormat = new SimpleDateFormat("yyyy-MM-dd"); for (Iterator it = usersList.iterator(); it.hasNext();) { Map user = (Map) it.next(); Map map = new HashMap(); map.put("uid", user.get("ID")); map.put("availDate", (dataFormat.format(user.get("AVAILDATE"))).toString()); //日期处理
JSONObject json = JSONObject.fromObject(map); alist.add(json);

}

JSONArray jsonlist = JSONArray.fromObject(alist); Map map = new HashMap();
map.put("user", jsonlist); JSONObject json = JSONObject.fromObject(map); out.print(json);

评论(1)

  1. #1 楼 · readythink · 2009-07-17 09:40

    ~_~,我也遇到这个问题了,你已经解决了吗?

评论功能维护中,当前仅展示历史评论。