Sencha触摸商店与日期字段

Uma*_* A. 0 model store sencha-touch

我有一个Model with Date字段和Store,它从XML加载,其日期字段与字符串相同.sencha会自动将其解析为Date还是我需要手动执行此操作?

Ext.regModel('News', {
    idProperty: 'Id',
    fields: [
        { name: 'Id', type: 'int' },
        { name: 'Title', type: 'string' },
        { name: 'PostedOn', type: 'date' },
        { name: 'PostedBy', type: 'string' },
        { name: 'Details', type: 'string' }
    ]
});

var newsRemoteStore = new Ext.data.Store({
    model: 'News',
    sorters: [{
        property: 'PostedOn',
        direction: 'DESC'
    }],
    proxy: {
        type: 'ajax',
        url: BaseURL + 'News.php',
        reader: {
            type: 'xml',
            root: 'News',
            record: 'New'   
        }
    },
    getGroupString: function(record) {
        if (record && record.data.PostedOn) {
            return record.get('PostedOn').toDateString();
        }
        else {
            return '';
        }
    }
});
Run Code Online (Sandbox Code Playgroud)

我问,因为即使xml响应中有日期,日期字段也是空的.

<PostedOn>2011-07-04 16:00:19</PostedOn>
Run Code Online (Sandbox Code Playgroud)

Ant*_*ony 5

Sencha Touch 1.1版支持auto,string,int,float,boolean和date(参考Sencha Touch 1.1 API文档