I use server-side processing according to the Django example in DataTables . I am returning datetime values ββin this format "yyyy-mm-dd hh: mm: ss". These date time values ββare currently displayed (for example):
December 18, 2011, 11:59 pm
I would like to display only the date, not the date and time.
This is what I have on my html page:
<script type="text/javascript"> $(document).ready(function() { $('#certs-table').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers", "bProcessing": true, "bServerSide": true, "sAjaxSource": "/cars/get_cars_list/", "iDisplayLength": 10, "aoColumnDefs": [ { "aTargets": [0], "bVisible": false, "bSearchable": false}, { "aTargets": [1], "fnRender": function ( oObj ) { return '<a href=\"/cars/' + oObj.aData[0] + '/\">' + oObj.aData[1] + '</a>'; }, "bSearchable": true, }, { "aTargets": [2], "bSearchable": true}, { "aTargets": [3], "bSearchable": false, "sType": 'date'}, ] }); } ); </script>
The date is the 4th column, i.e. aTarget [3].
How do I display only part of the date, please? I just started using DataTables / JQuery yesterday, so I would really like the example. Thanks.
source share