Created
October 24, 2018 14:58
-
-
Save paltman/06ffcd6d7bb41da3bbc7e26328f19ce4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// components/PrettyDate.vue | |
<template> | |
<span v-if="date" class="pretty-date" :title="date">{{ formattedDate }}</span> | |
</template> | |
<script> | |
import { format } from 'date-fns'; | |
export default { | |
name: 'pretty-date', | |
props: ['date'], | |
computed: { | |
formattedDate() { | |
return format(this.date, 'MMM dd'); | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment