14.06 Filter - Format the Date Nicely

This commit is contained in:
Fredrick W Warren 2021-02-11 10:23:05 -08:00
parent e6985d0e89
commit d3af477f86

View File

@ -33,7 +33,7 @@
<q-item-label <q-item-label
class="row justify-end" class="row justify-end"
caption> caption>
{{ task.dueDate }} {{ task.dueDate | niceDate }}
</q-item-label> </q-item-label>
<q-item-label <q-item-label
class="row justify-end" class="row justify-end"
@ -73,6 +73,8 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import editTask from 'components/Tasks/Modals/EditTask.vue' import editTask from 'components/Tasks/Modals/EditTask.vue'
import { date } from 'quasar'
const { formatDate } = date
export default { export default {
name: 'Task', name: 'Task',
@ -85,6 +87,11 @@ export default {
showEditTask: false showEditTask: false
} }
}, },
filters: {
niceDate (value) {
return formatDate(value, 'MMM D')
}
},
methods: { methods: {
...mapActions('tasks', ['updateTask', 'deleteTask']), ...mapActions('tasks', ['updateTask', 'deleteTask']),
promptToDelete (id) { promptToDelete (id) {