title: Extjs retrieving and writing timestamps
body: <p>So I have this small Extjs application which consists of a grid with users. Each user has a field where I send from the server the date when he subscribed as a timestamp value (unix).</p>
  
  <pre><code>Ext.define('AP.model.User', {
          extend: 'Ext.data.Model',
          fields: [
          { name: 'id', type: 'int', persist : false },
          { name: 'date_added', type: 'date', dateFormat: 'timestamp'},
          { name: 'username', type: 'string', persist : false }
      ]
  });
  </code></pre>
  
  <p>The grid has a renderer so I can render that timestamp into a human readable format such as <code>29-Oct-2011 04:00 am</code>:</p>
  
  <pre><code>...
  {
      header: 'Date added',
      align: 'center',
      sortable: true,
      dataIndex: 'date_added',
      width: 140,
      fixed: true,
      renderer: Ext.util.Format.dateRenderer('d-M-Y h:i a')
  }
  ...
  </code></pre>
  
  <p>Now, everything works as intended, the values are displayed correctly but, I also have a form to edit each record in part. In my form, I can edit the date added field by providing a  field <code>xtype: 'datefield'</code> which lets me chose the date. When I chose a new date for my record it shows something like <code>11/29/2011</code> (from my date above) but when I submit that form to update the record it posts something like this in the request payload: <code>{"date_added": "NaN-NaN-NaNTNaN:NaN:NaN"}</code>.</p>
  
  <p>Can anybody shed a light on how do I go about saving dates in Extjs on fields that are retrieved as timestamps?</p>