jQWidgets Forums

jQuery UI Widgets Forums Grid Problem with showing a date

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

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • Problem with showing a date #51183

    wormie007
    Participant

    My problem is that my database (Microsoft SQL Server) I have a date field, but to display it in the grid using internet explorer, the date time aren’t correctly displayed.

    using the following line:
    {text: ‘Date’, ColumnGroup: ‘Events’ datafield’ Date ‘, cellsformat:’ dd-MM-yyyy HH: mm: ss’, width: ‘28% ‘},

    the hour an minutes aren’t correctly, it appears 01 in hour and 00 in minutes.
    How can i solve it?

    I use internet explorer 8.0.7601.17514

    Problem with showing a date #51185

    Peter Stoev
    Keymaster

    Ho wormie007,

    Sometimes, it is necessary to describe your date’s format when you define the data fields array of your data source object.

    Ex: { name: ‘SubmitDate’, type: ‘date’, format: “yyyy-MM-ddTHH:mm:ss-HH:mm” }

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Problem with showing a date #51191

    wormie007
    Participant

    Sorry but it doesn’t work.

    Do you knwo another possible cause for this kind of problem?

    Problem with showing a date #51193

    Peter Stoev
    Keymaster

    Hi wormie007,

    Could you send us a sample which demonstrates your scenario and we will take a look at it?

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Problem with showing a date #51197

    wormie007
    Participant

    var source =
    {
    datatype: “xml”,

    datafields: [
    { name: ‘IdAplicacion’, type: ‘int’ },
    { name: ‘Categoria’, type: ‘string’ },
    { name: ‘IdAplicacion’, type: ‘int’ },
    { name: ‘Fecha’, type: ‘date’, format: ‘yyyy-MM-ddTHH:mm:ss-HH:mm’ },
    { name: ‘Usuario’, type: ‘string’ },
    { name: ‘Ubicacion’, type: ‘string’ },
    { name: ‘Descripcion’, type: ‘string’ },
    { name: ‘Contenido’, type: ‘string’ }
    ],
    async: false,
    record: ‘Table’,
    pagesize: 10,
    url: ‘Metodos.aspx/GetEvento’

    };

    $(“#jqxgrid”).jqxGrid(
    {
    source: dataAdapter,
    theme: theme,
    width: ‘80%’,
    editable: false,
    statusbarheight: 45,
    showtoolbar: true,
    sortable: true,
    pageable: true,
    filterable: false,
    autoheight: true,
    autorowheight: false,
    columnsreorder: true,
    autoshowfiltericon: false,
    localization: getLocalization(),
    columnsresize: true,

    rendertoolbar: function (toolbar) {
    var container = $(“<div style=’text-align:center;’></div>”);
    var title = $(“<b>Administracion de Eventos</b>”);
    container.append(title);
    toolbar.append(container);
    },

    columns: [
    { text: ‘Id Aplicacion’, columngroup: ‘Eventos’, datafield: ‘IdAplicacion’, width:’12%’ },
    { text: ‘Categoria’, columngroup: ‘Eventos’, datafield: ‘Categoria’, width: ‘12%’ },

    {text: ‘Fecha’, columngroup: ‘Eventos’, datafield: ‘Fecha’, cellsformat: ‘dd-MM-yyyyTHH:mm:ss’, width: ‘28%’ },

    { text: ‘Usuario’, columngroup: ‘Eventos’, datafield: ‘Usuario’, width: ‘12%’ },
    { text: ‘Ubicacion’, columngroup: ‘Eventos’, datafield: ‘Ubicacion’, width: ‘12%’ },
    { text: ‘Descripcion’, columngroup: ‘Eventos’, datafield: ‘Descripcion’, width: ‘12%’ },
    { text: ‘Contenido’, columngroup: ‘Eventos’, datafield: ‘Contenido’, width: ‘12%’ },
    ],
    columngroups: [
    { text: ‘Eventos’, align: ‘center’, name: ‘Eventos’ }
    ]
    });
    });

    I think this is all you needed.

    Problem with showing a date #51217

    Peter Stoev
    Keymaster

    Hi wormie007,

    That’s almost what I need. Could you send a sample of your data so I can check whether the “format” is correct for your case. It should match the Date format of your data source.

    Best Regards,
    Peter Stoev

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

    Problem with showing a date #51236

    wormie007
    Participant

    a sample of a date that i have in my source is like 14/03/2014 17:09:44

    Problem with showing a date #51238

    Peter Stoev
    Keymaster

    Hi wormie007,

    This means that the format for you should be: format: ‘dd/MM/yyyy HH:mm:ss’

    Best Regards,
    Peter Stoev

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

    Problem with showing a date #51239

    wormie007
    Participant

    I have tested in firefox and it works fine, but in internet explorer that i cite you above, it doesn’t work, and would need to be for the explorer. Have you kow a patch or something to solve it?

    Problem with showing a date #51261

    Peter Stoev
    Keymaster

    Hi wormie007,

    We cannot reproduce such issue with IE8 which means that we cannot provide a patch for something which we can’t verify. If you wish, provide a sample which demonstrates a problem and which we can test, because the code from your post does not have data and we can’t test it in the way it is now. You can use jsfiddle.net to prepare online sample.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.