[英]laravel datatable changing date format - Ajax error
我尝试使用下面的函数来更改laravel datatable
的日期格式,但是它不起作用。
我收到以下错误消息:
DataTables警告:表id = users-table-Ajax错误。 有关此错误的更多信息,请参见http://datatables.net/tn/7
码:
$users=Checks::select(['details','postingdate','description','amount','type','slip','vendor_id','category_id']);
return Datatables::of($users)->editColumn('postingdate', function ($user) {
return $user->postingdate->format('d-m-Y');
})->make(true);
我该如何解决?
$users=Checks::select(['details',
'postingdate','description','amount','type','slip','vendor_id','category_id']);
return Datatables::of($users)->editColumn('postingdate', function ($user)
{
//change over here
return date('Y/d/m', strtotime($user->postingdate) );
})->make(true);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.