Results 1 to 2 of 2

Thread: date field in IE8 shows NaN-NaN-0NaN

  1. #1

    Default date field in IE8 shows NaN-NaN-0NaN

    Hi,

    I am displaying a date field in a grid panel and it works in all browsers, except IE8. In IE8 it worked, but since the last update it now shows NaN-NaN-0NaN instead of (for example) 31-12-2012. I use a Dutch formatting of dates (dd-mm-yyyy).
    The problem is the use of xtype: 'datecolumn' in the grid panel, but I need that to correctly display the date format. Furthermore I need to be able to do sorting on the date fields.

    Code used:

    Code:
    Ext.define('SomeModel', {
        extend: 'Ext.data.Model',
        fields: ['somedate']
      });
    
    var metingModelStore = Ext.create('Ext.data.Store', {
        model: "SomeModel",
        storeId: "SomeModelStore",
        sorters: [
          {property: 'somedate', direction: 'ASC'}
        ],
        remoteSort: false,
        remoteFilter: true,
        pageSize: 50,
        proxy: {
          type: 'ajax',
          url: 'something/selection',
          reader: {
            type: 'json',
            root: 'items'
          },
          actionMethods: {
            create: 'POST', read: 'POST', update: 'POST', destroy: 'POST'
          },
          simpleSortMode: true
        },
        updateCounter: function () {
        }
      });
    
    overview_panel = Ext.create('Ext.grid.Panel', {
        store: overviewModelStore,
        disableSelection: false,
        loadMask: true,
        viewConfig: {
          id: 'gv1',
          trackOver: false,
          preserveScrollOnRefresh: true,
          stripeRows: true
        },
        // grid columns
        columns: [
          { text: "Some Date", 
            dataIndex: 'somedate', 
            xtype: 'datecolumn', 
            format: 'd-m-Y', 
            align: 'left', 
            sortable: true, 
            menuDisabled: true, 
            tdCls: 'highlight',
            doSort: function(state) {
                var field = this.getSortParam();
                overviewModelStore.sort({
                    property: field,
                    direction: state,
                    sorterFn: function(v1, v2){
                        v1 = v1.get(field);
                        v2 = v2.get(field);
                        if (v1 > v2 || v1 === null) {return 1}
                        if (v1 < v2 || v2 === null) {return -1}
                        return 0;
                    }
                });
            }
          },
        ],
    });

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Looks like it's a bug in IE/Safari:
    http://biostall.com/javascript-new-d...date-in-safari

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •