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