Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Last active May 9, 2020 14:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/d00f8aa938e2b5a32a36515b29ad9354 to your computer and use it in GitHub Desktop.
Save uno-de-piera/d00f8aa938e2b5a32a36515b29ad9354 to your computer and use it in GitHub Desktop.
import moment from 'moment'
export default async ({ Vue }) => {
Vue.prototype.$moment = moment
}
<template>
<q-page class="flex flex-center">
{{ monthsAgo }}
</q-page>
</template>
<script>
export default {
name: 'PageIndex',
mounted () {
this.$moment.locale('es')
},
computed: {
monthsAgo () {
return this.$moment([2020, 0, 10]).fromNow()
}
}
}
</script>
module.exports = function (/* ctx */) {
return {
boot: [
'moment'
],
}
}
@rdavid4
Copy link

rdavid4 commented May 9, 2020

Tambien funciona poniendo la opcion locale en el boot file. Gracias igualmente me ha servido.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment