Note that there are some explanatory texts on larger screens.

plurals
  1. POjqgrid datetime column sorting in 24 hour format
    primarykey
    data
    text
    <p>I am using a json object as follows from spring MVC to populate the jqgrid by using a json reader.</p> <pre><code>{ "rows": [ { "id": 1, "startTime": "Mar 4 08:00", "projectId": "Proj_001", "customerId": "Cust1", "divisionId": "Div1" }, { "id": 2, "startTime": "Mar 5 15:00", "projectId": "Proj_001", "customerId": "Cust1", "divisionId": "Div1" }, { "id": 3, "startTime": "Apr 14 22:00", "projectId": "Proj_001", "customerId": "Cust1", "divisionId": "Div1" } ] } </code></pre> <p>I need to sort the </p> <blockquote> <p>startTime</p> </blockquote> <p>column which comes in 24hour time format (as above in the json object). i tried do some workaround but still unable to succeed. </p> <p>jqgrid code - </p> <pre><code>{name:'startTime', index:'startTime', width:90,align:"left",sorttype:'datetime',datefmt:'M d, Y at h:i',sortable: true,editrules:{date:true} }, </code></pre> <p>i will not using AM/PM notation here. i saw in jqgrid.base.js it uses AM/PM notation to sort. can anyone please shed some light on this? i was unable to find any jqgrid example for using date with 24hour time format that will do sort. Thank you in advance. </p> <p>my jqgrid code - </p> <pre><code>jq(function(){ jq("#testgrid").jqGrid({ url:"/getall.html", datatype: 'json', mtype: 'GET', colNames:['Id','Start Time','Cust.Id','Div.Id','Proj.Id'], colModel :[ {name:'id', index:'id', width:90,align:"left",hidden: true}, {name:'startTime', index:'startTime', width:90, align:"left", sorttype:'datetime', datefmt:'M d h:i',sortable: true, editrules:{date:true}}, {name:'divisionId', index:'divisionId', width:100,align:"left"}, {name:'departmentId', index:'departmentId', width:120,align:"left"}, {name:'projectId', index:'projectId', width:100,align:"left"}, ], pager: '#testpager', loadonce: true, sortname: 'projectId', sortorder: 'asc', viewrecords: true, multiselect: true, //to hide pager buttons pgbuttons:false, recordtext:'', pgtext:'', gridview: true, caption: 'my JQGRID', jsonReader : { root: "rows", page: "page", total: "total", records: "records", repeatitems: false, cell: "cell", id: "id" } }); //toolbar search //jq("#testgrid").jqGrid('filterToolbar', // {stringResult:true,searchOnEnter:false}); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload