1<!--You should use a custom row cell :-->
2
3<v-data-table :headers="headers" :items="logs">
4 <template v-slot:item.createdOn="{ item }">
5 <span>{{ new Date(item.createdOn).toLocaleString() }}</span>
6 </template>
7</v-data-table>
8
1$projects = Project::select('id', 'name', 'date_start', 'date_end');
2return Datatables::of($projects)
3 ->editColumn('date_start', function ($request) {
4 return $request->date_start->format('Y-m-d'); // human readable format
5 })
6 ->editColumn('date_end', function ($request) {
7 return $request->date_end->format('Y-m-d'); // human readable format
8 })
9 ->filterColumn('date_start', function ($query, $keyword) {
10 $query->whereRaw("DATE_FORMAT(date_start,'%Y-%m-%d') like ?", ["%$keyword%"]); //date_format when searching using date
11 })
12 ->filterColumn('date_end', function ($query, $keyword) {
13 $query->whereRaw("DATE_FORMAT(date_end,'%Y-%m-%d') like ?", ["%$keyword%"]); //date_format when searching using date
14 })
15 ->make(true);
1<v-data-table :headers="headers" :items="logs">
2 <template v-slot:item.createdOn="{ item }">
3 <span>{{new Date(item.createdOn).toLocaleString()}}</span>
4 </template>
5 </v-data-table>