add date method and link to external paper
This commit is contained in:
parent
c88fb4d28d
commit
f0164afe9f
1 changed files with 6 additions and 2 deletions
|
@ -48,13 +48,17 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return filteredPapers
|
return filteredPapers
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async fetchData() {
|
async fetchData() {
|
||||||
this.papers = await (await fetch(this.apiUri)).json()
|
this.papers = await (await fetch(this.apiUri)).json()
|
||||||
},
|
},
|
||||||
openPaper() {}
|
openPaper() {}
|
||||||
|
date(paperDate: String) {
|
||||||
|
const date = new Date(paperDate)
|
||||||
|
return new Intl.DateTimeFormat('de-DE', { dateStyle: 'full' }).format(date)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -74,7 +78,7 @@ export default {
|
||||||
@click.prevent="openPaper()"
|
@click.prevent="openPaper()"
|
||||||
>
|
>
|
||||||
<h4 class="text-xl">{{ paper.name }}</h4>
|
<h4 class="text-xl">{{ paper.name }}</h4>
|
||||||
<p>{{ paper.published_at }}: {{ paper.paper_type}} von {{ paper.originator }}</p>
|
<p>{{ date(paper.published_at) }}: <a :href="paper.url" class="text-secondary-button-500">{{ paper.paper_type}} von {{ paper.originator }}</a></p>
|
||||||
</article>
|
</article>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in a new issue