format date in vue code example
Example 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>
Example 2: vue print date
import moment from 'moment'
Vue.filter('formatDate', function(value) {
if (value) {
return moment(String(value)).format('MM/DD/YYYY hh:mm')
}
}