title: How to convert timestamp to customized date format in ExtJS4.1 model?
body: <p>I want to convert the timestamp to customized date format right after the server returns the data.
  I tried to use the "convert" in Ext.data.field : <a href="http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Field-cfg-convert" rel="nofollow">http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Field-cfg-convert</a></p>
  
  <p>But I cannot make it right. This is my model.</p>
  
  <pre><code>Ext.define('AM.model.Comment',{
      extend: 'Ext.data.Model',
      fields: [
          { name: 'createdTime', type: 'date', convert:function(v,record){record.parseDate(v,record);}}, // datetime
      ],
  
      proxy: {
          type: 'rest',
          url:'../comments',
          writer:{
              type:'json'
          },
          reader: {
              type: 'json'
          }
      },
      parseDate:function(v,record){
          console.log(v); //show 1347465600000 
          console.log(Ext.Date.format(new Date(v), 'Y-m-d')); //show 2012-09-13
          return Ext.Date.format(new Date(v), 'Y-m-d');
      }
  });
  </code></pre>
  
  <p>After loading, I checked firebug and found the field "createdTime" is "undefined".
  Can someone point out my mistake? Thanks!</p>
  
  <p>I can achieve that without using "convert", just use <code>Ext.Date.format(new Date(v), 'Y-m-d')</code> in other component. But I think it will be better to do that in model. Then every component can always read the right date format as querying it. </p>