Skip to content

Instantly share code, notes, and snippets.

Vue.filter('formatDate', function(value) {
if (value) {
return moment(String(value)).format('DD/MM/YYYY hh:mm:ss')
}
return 'N/A';
});
<template>
<div>{{ user.LastLogin | formatDate }}</div>
</template>
<template>
<div>{{ lastLogin }}
</template>
<script>
export default {
computed: {
lastLogin () {
return this.$options.filters.formatDate(this.user.LastLogin)
}
{ id: 1, name: "Elemento 1", parentId: null }
<template>
<q-page class="flex flex-center">
{{ monthsAgo }}
</q-page>
</template>
<script>
export default {
name: 'PageIndex',
mounted () {