Date rendered in human readable format.

This commit is contained in:
2021-01-03 22:58:32 +01:00
parent 9aaa749787
commit a426b730f3

View File

@@ -4,7 +4,7 @@
<h2>{{ post.title }}</h2> <h2>{{ post.title }}</h2>
</router-link> </router-link>
<p><span>{{ post.date }}</span> by <span>{{ post.author }}</span></p> <p><span>{{ humanReadableDate(post.date) }}</span> by <span>{{ post.author }}</span></p>
<img v-if="post.thumbnail" :src="post.thumbnail" /> <img v-if="post.thumbnail" :src="post.thumbnail" />
@@ -15,12 +15,17 @@
</template> </template>
<script> <script>
import { humanReadableDate } from "@/utils";
export default { export default {
props: { props: {
post: { post: {
type: Object, type: Object,
required: true required: true
} }
},
methods: {
humanReadableDate(date) { return humanReadableDate(date) }
} }
} }
</script> </script>
@@ -29,6 +34,7 @@ export default {
h2 { h2 {
font-size: 2rem; font-size: 2rem;
display: inline-block;
} }
img { img {