jquery datatable returning current datetime
{
title: "Date",// name
render: function (data, type, row) {//data
return moment(row.updatedDate).format('DD/MM/YYYY hh:mm:ss');
}
}
jquery datatable returning current datetime
{
title: "Date",// name
render: function (data, type, row) {//data
return moment(row.updatedDate).format('DD/MM/YYYY hh:mm:ss');
}
}
laravel datatable format date column
$projects = Project::select('id', 'name', 'date_start', 'date_end');
return Datatables::of($projects)
->editColumn('date_start', function ($request) {
return $request->date_start->format('Y-m-d'); // human readable format
})
->editColumn('date_end', function ($request) {
return $request->date_end->format('Y-m-d'); // human readable format
})
->filterColumn('date_start', function ($query, $keyword) {
$query->whereRaw("DATE_FORMAT(date_start,'%Y-%m-%d') like ?", ["%$keyword%"]); //date_format when searching using date
})
->filterColumn('date_end', function ($query, $keyword) {
$query->whereRaw("DATE_FORMAT(date_end,'%Y-%m-%d') like ?", ["%$keyword%"]); //date_format when searching using date
})
->make(true);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us