jQuery数据表将日期显示为[object object]


jQuery datatables displays date as [object Object]

下面的代码可以很好地查询php web服务并使用jQuery数据表显示结果。

问题是日期值被作为[对象对象]返回。

有什么想法我为什么会得到这些价值观以及如何解决它们吗?

我的代码如下:

 <script type="text/javascript" charset="utf-8">
$(document).ready(function() {
    /* Init DataTables */
$("#example").dataTable( {
    "sProcessing" : true,
"sDom":'T<"clear">',
"sJQueryUI": true,
"sPaginationType": "full_numbers",
"sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>',
    "sAjaxSource" : "Requests.php",
    "sAjaxDataProp" : "",
    "sDestroy" : false,
    "sScrollY": "400px",
    "fnServerData" : function(sSource, aoData, fnCallback) {
        request = $.ajax({
            "dataType" : "json",
            "type" : "GET",
            "url" : sSource,
            "data" : aoData,
            "success" : fnCallback
        });
    },
         "aoColumns" : [
{
                        "mDataProp": "RequestID", "sWidth": "50px", sSortable: true,
                        "bSearchable": false,
                        "bSortable": false,
                        "fnRender": function (oObj)
                        {
                            // oObj.aData[0] returns the RequestID
                            return "<a href='details.php?RequestID="
                                + oObj.aData["RequestID"] + "'> " + oObj.aData["RequestID"] + " </a>";
                        }
                       },
          { mDataProp: "RequestDate",  "sWidth": "100px", sSortable: true },
          { mDataProp: "RequestorFullName",  "sWidth": "150px", sSortable: true },
          { mDataProp: "PrimarySiteContactDisplay",  "sWidth": "250px", sSortable: true },
          { mDataProp: "RequestLocation",  "sWidth": "150px", sSortable: true },
          { mDataProp: "RequestDescription",  "sWidth": "200px", sSortable: true },
          { mDataProp: "RequestStatus",  "sWidth": "100px", sSortable: true },
        ],
      })
$('#example tbody tr').click(function () {
    if ($(this).hasClass('selected')) $(this).removeClass('selected');
    else
    {
        $(this).siblings('.selected').removeClass('selected');
        $(this).addClass('selected');
    }
});
   });
</script>

<div id="TableToolsToolbar" class="fg-buttonset ui-helper-clearfix"> </div>
<table><tr><td></td</tr></table>
<table cellpadding="0" cellspacing="0" border="0" style="width:100%;" class="display" id="cityworks">
<thead style="background-color:#DC5807; color:White; font-weight:bold;font-size:10pt;">
<tr style="border:solid 1px #000000">
    <th>ID</th>
    <th>Date</th>
    <th>Requestor</th>
    <th>Site Contact</th>
    <th>Location</th>
    <th>Description</th>
    <th>Status</th>
  </tr>
 </thead>
<tbody>
</tbody>
</table>
</div>

我能够修复它。

我不得不在服务器端将日期转换为字符串来解决这个问题

convert(char(10),aa.[requestdate],101) as RequestDate

感谢大家的反馈。