Answers for "vue datatable date format"

1

vue datatable date format

<!--You should use a custom row cell :-->

<v-data-table :headers="headers" :items="logs">
  <template v-slot:item.createdOn="{ item }">
    <span>{{ new Date(item.createdOn).toLocaleString() }}</span>
  </template>
</v-data-table>
Posted by: Guest on January-06-2021
1

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);
Posted by: Guest on July-24-2020
1

v-data-table format date

<v-data-table :headers="headers" :items="logs">
         <template v-slot:item.createdOn="{ item }">
           <span>{{new Date(item.createdOn).toLocaleString()}}</span>
         </template>
      </v-data-table>
Posted by: Guest on August-12-2020

Browse Popular Code Answers by Language