Last active
April 24, 2020 16:05
-
-
Save NickyMeuleman/d39eb027d5d9952d3a0811d70f68a064 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
<template> | |
<time v-bind:datetime="dateObject | toISODate"> | |
{{ dateObject | toPrettyDate }} | |
</time> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { | |
dateObject: new Date('1991-02-01'), | |
}; | |
}, | |
filters: { | |
toISODate(value) { | |
return value.toISOString(); | |
}, | |
toPrettyDate(value) { | |
return new Intl.DateTimeFormat('nl-BE', { | |
year: 'numeric', | |
month: 'long', | |
day: 'numeric', | |
}).format(value); | |
}, | |
}, | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment