Skip to content

Instantly share code, notes, and snippets.

@NickyMeuleman
Last active April 24, 2020 16:05
Show Gist options
  • Save NickyMeuleman/d39eb027d5d9952d3a0811d70f68a064 to your computer and use it in GitHub Desktop.
Save NickyMeuleman/d39eb027d5d9952d3a0811d70f68a064 to your computer and use it in GitHub Desktop.
<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