Fix checking for undefined behaviour when viewing a task

This commit is contained in:
kolaente 2021-03-23 22:26:54 +01:00
parent 6fbfef661d
commit 35ed61839d
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 9 additions and 1 deletions

View file

@ -1,7 +1,7 @@
<template> <template>
<div class="heading"> <div class="heading">
<h1 class="title task-id"> <h1 class="title task-id">
{{ task.getTextIdentifier() }} {{ task.getTextIdentifier && task.getTextIdentifier() ? task.getTextIdentifier() : '' }}
</h1> </h1>
<div class="is-done" v-if="task.done">Done</div> <div class="is-done" v-if="task.done">Done</div>
<h1 <h1

View file

@ -182,6 +182,10 @@ Vue.component('card', Card)
Vue.mixin({ Vue.mixin({
methods: { methods: {
formatDateSince: date => { formatDateSince: date => {
if (date === null) {
return ''
}
if (typeof date === 'string') { if (typeof date === 'string') {
date = new Date(date) date = new Date(date)
} }
@ -198,6 +202,10 @@ Vue.mixin({
return formatted return formatted
}, },
formatDate: date => { formatDate: date => {
if (date === null) {
return ''
}
if (typeof date === 'string') { if (typeof date === 'string') {
date = new Date(date) date = new Date(date)
} }