2

I have a problem with my date sorter. I get my date out a XML file and looks like this:

<date>18-10-2011</date>

my store is this:

 Ext.define('blockedList', {
    extend: 'Ext.data.Model',
    fields: [{
        name: 'sourceFile',
        type: 'text',
        mapping: 'sourceFile'

    }, {
        name: 'summaryFile',
        type: 'text',
        mapping: 'summaryFile'

    }, {
        name: 'date',
        type: 'date',
        mapping: 'date'

    }, {
        name: 'total',
        type: 'float',
        mapping: 'total'

    }]
});

But when i sort on date it is not doing the correct sorting. If i have these dates: 1-1-2011, 3-1-2011 and 1-2-2011 it sorts like this: 1-1-2011 1-2-2011 3-1-2011

how can i get this sorting working like it should?

Thanks

Rick Weller
  • 1,258
  • 9
  • 35
  • 54

1 Answers1

4

I believe you need to set the dateFormat within the field. For example I have dates returning from a JSON request and the field has dateFormat: 'MS' attribute.

I'd give this a read on Ext's dateformats. Hope that helps.

Amalea
  • 526
  • 1
  • 6
  • 17