---
title: "ext 时间显示小问题，麻烦大家了！！"
author: "cleverbing"
date: "2009-03-10T14:48:39Z"
tags: []
slug: "ext"
draft: false
lastmod: "2009-03-10T14:50:26Z"
id: 346611
url: "https://cleverbing.iteye.com/blog/346611"
---

我 做个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);