jQWidgets Forums

jQuery UI Widgets Forums Grid Date format issue

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Date format issue #76863

    damerval
    Participant

    Hello,
    I have some data to display in a grid. The data looks like this:

    [{“gid”:1,”tpd”:{“date”:”2015-09-09 00:00:00″,”timezone_type”:3,”timezone”:”UTC”},”tpt”:”Interim Treatment plan”,”tps”:{“date”:”2015-09-14 00:00:00″,”timezone_type”:3,”timezone”:”UTC”},”goal”:”Test goal to verify goals functionality”,”reachdt”:”10\/31\/2015″}]

    This is encapsulated in a source and data adapter with this code:
    var clientGoalsSource = {
    datatype: “json”,
    datafields: [{name: “gid”, type: “int”},
    {name: “tpd”, type: “date”},
    {name: “tpt”, type: “string”},
    {name: “tps”, map: “tps>date”, type: “date”, format: “yyyy-MM-dd”},
    {name: “goal”, type: “string”},
    {name: “reachdt”, type: “string”}],
    url: “data/clientgoals_json.php”
    };
    var dAdapterClientGoals = new $.jqx.dataAdapter(clientGoalsSource);

    My problem is that the format string appears to be ignored: The grid displays “Mon Sep 14 2015 00:00:00 GMT-0800 (Alaska Daylight Time)” regardless of the format string in there. My guess is that it’s not really seen as a date? But I am clueless as to how to cause that data to be seen as a date. Please show me how to get there from here.

    Thank you!

    Date format issue #76866

    Peter Stoev
    Keymaster

    Hi damerval,

    The issue here is that the format property is not set correctly. It should match the format of your Data source. In addition, the Grid displays date cells only depending on the column’s cellsformat property as shown in our online demos.

    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.