Date rendered in human readable format.
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user