jQWidgets Forums

jQuery UI Widgets Forums Grid Date Format Confusion

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Date Format Confusion #54411

    jonfrain
    Participant

    I have a date field that when treated like a string displays in the form:

    Apr 01 13 07:28:00 AM

    I defined the field as a date as below

    datafields: [     
                { name: 'location_id',          type: 'string'},
                { name: 'location_description', type: 'string'},
                { name: 'location_type',        type: 'string'},
                { name: 'accuracy_score',       type: 'float'},
              <strong>  { name: 'audit_open_date',      type: 'date' },</strong><ul>
                { name: 'audit_template',       type: 'string'},
                { name: 'inventory_user_name',  type: 'string'}
            ],

    And the columns as follows

     columns: [
                        { text: 'Location Name',        datafield: 'location_id',           width: '12%' },
                        { text: 'Location Description', datafield: 'location_description',  width: '20%' },
                        { text: 'Location Type',        datafield: 'location_type',         width: '12%' },
                        { text: 'Accuracy Score',       datafield: 'accuracy_score',        width: '12%' },
                       <strong> { text: 'Audit Open Date',      datafield: 'audit_open_date',       cellsformat: 'MMM DD yy HH:mm:ss tt', width: '12%' },</strong></ul>

    But it still seems to be sorting it as a string as April 2nd of 2013 comes after April 1st of 2014. Any thoughts?

    Sorting ints and strings has worked fine so far.

    { text: ‘Audit Template’, datafield: ‘audit_template’, width: ‘15%’ },
    { text: ‘Cell Technician’, datafield: ‘inventory_user_name’, width: ‘17%’ }
    ]

    Date Format Confusion #54421

    Peter Stoev
    Keymaster

    Hi jonfrain,

    If the type is set to “date”, Your date column would be sorted by Date’s value, not by its String value. As we cannot reproduce your issue, please provide a full sample which demonstrates it with jQWidgets 3.2.2

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.