jQWidgets Forums

jQuery UI Widgets Forums Grid Cellformat shows wrong results

This topic contains 6 replies, has 2 voices, and was last updated by  punkrack 12 years ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • Cellformat shows wrong results #23174

    punkrack
    Participant

    Hi!

    I have in my database, a timestamp : 2013-06-14 12:38:47. This is 12:38 has in “noon:38”

    For that column, I have a cellsformat: ‘d MMMM yyyy, HH:mm tt

    which displays properly EXCEPT, the time is ‘wrong’. Instead of being 12:38 PM, it shows 00:38 AM.

    If it’s 13:00, it shows 13:00 PM.

    The type is ‘date’ for that datafield.

    EDIT: BTW, it displays properly in chrome (12:38 PM), but does not in Firefox and IE (10)

    Cellformat shows wrong results #23184

    Peter Stoev
    Keymaster

    Hi,

    HH is used for 24 hours formatting. For 12 hours formatting, use hh as a format string.

    Best Regards,
    Peter Stoev

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

    Cellformat shows wrong results #23432

    punkrack
    Participant

    Hi!
    Thanks for the reply.

    I need 24h formating.
    My cellsformat is : cellsformat: ‘d MMMM yyyy, HH:mm’

    Like I mentionned, in the 24 hours formatting, “noon” puts 00 but it should put 12 with the 24 hour format.

    See print screens provided (Firefox wrong, chrome ok)

    http://colligetest.ccdmd.qc.ca/images/ff.png

    http://colligetest.ccdmd.qc.ca/images/chrome.png

    Cellformat shows wrong results #23433

    Peter Stoev
    Keymaster

    Hi,

    We will investigate whether we have or not such issue with the latest version and in case we reproduce it, we will resolve it as soon as possible. As a workaround, you may use the custom cells rendering capabilities of the Grid to render its values instead of the built-in rendering.

    Another option which you may try:

               var source =
    {
    localdata: data,
    datatype: "array",
    datafields:
    [
    { name: 'available', type: 'date', format: 'd MMMM yyyy, HH:mm tt' }
    ]
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    $("#jqxgrid").jqxGrid(
    {
    width: 670,
    source: dataAdapter,
    theme: theme,
    columnsresize: true,
    columns: [
    { text: 'Date', datafield: 'available', cellsalign: 'right', cellsformat: 'd MMMM yyyy, HH:mm tt' }
    ]
    });

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Cellformat shows wrong results #23850

    punkrack
    Participant

    2nd solution does not work.

    Thanks for the replies!
    I will wait and see at this point if you guys get the same error.

    Cellformat shows wrong results #23854

    Peter Stoev
    Keymaster

    Hi,

    The second solution is tested with the current version of jQWidgets and with the Date string from your post: “2013-06-14 12:38:47” and it displays it correctly formatted. Please, check the version of jQWidgets that you use on your side.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Cellformat shows wrong results #24522

    punkrack
    Participant

    Yes, I upgraded to the latest version and now it’s fixed.
    Thanks!

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

You must be logged in to reply to this topic.