jQWidgets Forums

jQuery UI Widgets Forums Grid Date cellsformat in IE9

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Date cellsformat in IE9 #48632

    purell007
    Participant

    Using cellsformat, some rows in my grid display the date correctly while others don’t.
    Incorrectly displays the date: 2010-08-25 15:10:24.880 to 2010-08-25T15:10:24.88-07:00
    Correctly displays the date: 2011-04-28 14:25:47.653 to 04-28-2011 2:25 PM

    datafields: [{ name: ‘Date_Begin’, type: ‘date’, format: “MM-dd-yyyy h:mm tt” }]

    columns: [{ text: ‘Date Begin’, editable: false, datafield: ‘Date_Begin’, width: 250, cellsformat: ‘MM-dd-yyyy h:mm tt’}]

    Is there a way to display all the dates in my grid correctly?

    Date cellsformat in IE9 #48634

    Peter Stoev
    Keymaster

    Hi purell007,

    The datafield’s format should describe the format in your data source.

    Example:

     var data = generatedata(2);
    data[0].date = "2010-08-25 15:10:24.880";
    data[1].date = "2011-04-28 14:25:47.653";
    
     var source = {
         localdata: data,
         datafields: [ {
             name: 'date',
             type: 'date',
             format: "yyyy-MM-dd HH:mm:ss.fff"
         }],
         datatype: "array"
     };
    
     var adapter = new $.jqx.dataAdapter(source);
     $("#jqxgrid").jqxGrid({
         width: 500,
         theme: 'energyblue',
         source: adapter,
         columns: [{
             text: 'Date',
             datafield: 'date',
             width: 500,
             cellsformat: 'MM-dd-yyyy h:mm tt'
         }]
     });

    Online: http://jsfiddle.net/jqwidgets/d8uQb/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Date cellsformat in IE9 #48643

    purell007
    Participant

    Actually the date in xml datasource is coming in as “2010-08-25T15:10:24.88-07:00” — what would the format be for that?

    Date cellsformat in IE9 #48653

    Peter Stoev
    Keymaster

    Hi purell007,

    May be something like: yyyy-MM-ddTHH:mm:ss.ff-HH:mm
    Example: http://jsfiddle.net/jqwidgets/5Dvt9/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.