jQWidgets Forums
jQuery UI Widgets › Forums › DataTable › Grouping by date change format in datatable
Tagged: datatable
This topic contains 1 reply, has 2 voices, and was last updated by Peter Stoev 10 years, 10 months ago.
-
Author
-
Hi Guys,
I am trying to group by column with Date. But in result it is always this format
Tue Jan 15 2013 00:08:00 GMT-0500 (Eastern Standard Time)
not like in data(mm/dd/yyyy) and not like I did format in datafields(mm/dd/yyyy).
Please see my code what can I do to make it look like in data format(mm/dd/yyyy).
Sorry I did put it on Grid section or Forum. Is not it the same with Grid too.
Thank you in advance.var theme='darkblue'; var queryList = [{ "ID": "1", "fms_id": "174861", "who": "Ritu Sharma", "ddate": "8/14/2013", "what": "The Arbitration Pre-Hearing for A14-0034567, Abdul Kamel vs. State Farm Mutual Automobile Insurance Company"},{ "ID": "2", "fms_id": "174862", "who": "Ivone Garsia", "ddate": "8/15/2013", "what": "The Mediation Pre-Hearing for James Smith booked on 8/12/2014"}]; // prepare the data var source = { datatype: "array", dataFields: [ { name: 'ID', type: 'number' }, { name: 'fms_id', type: 'string' }, { name: 'who', type: 'string' }, { name: 'ddate', type: 'date', format: 'mm/dd/yyyy' }, { name: 'what', type: 'string' } ], id: 'ID', localdata: queryList, sortcolumn: 'ddate', sortdirection: 'desc' }; var dataAdapter = new $.jqx.dataAdapter(source); $("#dataTable").jqxDataTable( { width: 240, pageable: true, sortable: false, theme: theme, pagerButtonsCount: 2, source: dataAdapter, columnsResize: true, groups: ['ddate','who'], columns: [ { text: 'who', dataField: 'who', hidden : true, }, { text: 'ddate', dataField: 'ddate', hidden : true, width: 50, cellsformat: 'mm/dd/yyyy' }, { text: 'Notes', dataField: 'what', width: 240 } ] });
Hi dchumak,
Please, look at your format string. It should be MM/dd/yyyy, not mm/dd/yyyy. mm is for minutes. The property’s name is cellsFormat in jqxDataTable, too. Regarding the Groups formatting – confirmed.
Regards,
Peter -
AuthorPosts
You must be logged in to reply to this topic.