jQWidgets Forums

jQuery UI Widgets Forums Grid Working with json dates

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Working with json dates #5069

    fmcorreia
    Member

    Hi,

    How can we format a JSON date to render in a certain format?

    if I set the cellsformat with ‘dd-MM-yyyy HH:mm’ it display the value as it is (in json format).

    What am i missing?

    Best Regards,

    Francisco Correia

    Working with json dates #5082

    Peter Stoev
    Keymaster

    Hi Francisco,

    Do you set the ‘date’ type in the data field initialization?

    Sample:

    var source =
    {
    datatype: "xml",
    datafields: [
    { name: 'ShippedDate', map: 'm\\:properties>d\\:ShippedDate', type: 'date' },
    { name: 'Freight', map: 'm\\:properties>d\\:Freight', type: 'float' },
    { name: 'ShipName', map: 'm\\:properties>d\\:ShipName' },
    { name: 'ShipAddress', map: 'm\\:properties>d\\:ShipAddress' },
    { name: 'ShipCity', map: 'm\\:properties>d\\:ShipCity' },
    { name: 'ShipCountry', map: 'm\\:properties>d\\:ShipCountry' }
    ],
    root: "entry",
    record: "content",
    id: 'm\\:properties>d\\:OrderID',
    url: url
    };

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Working with json dates #5374

    fmcorreia
    Member

    Hi,

    I receive this information through a ajax request to the webservice, is mandatory to define the source structure this way to render the date? I already define the columns using the answer properties in the grid, I would like to set the source with the ajax request answer and not “redefine” the columns.

    Working with json dates #5383

    Peter Stoev
    Keymaster

    Hi fmcorreia,

    It is important to define the datafields and set the ‘type’ of each datafield which is not string.

    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.