0

I am working in a Sencha Touch app, backend is running with SAP, and is sending in the json this odata string format '20140811'(for instance) if I define in the model this type nothing happens..

{
  name: "createdOn",
  type: "date",
  dateFormat: "DD-MM-Y"
}

How should I convert correctly Sap date format to Sencha type?

4

1 回答 1

0

我的解决方案是...

   {
    name: 'lastSurvey',
    type: 'auto',
    convert: function(date){
      var sNumber = date.replace(/[^0-9]+/g, ''),
        iNumber = sNumber * 1, //trick seventeen
        oDate = new Date(iNumber);
      return Ext.Date.format(oDate, 'd-m-Y');
    }
  },

欢迎对此解决方案提出意见!

于 2015-10-29T09:46:03.073 回答