Last active
May 9, 2020 14:54
-
-
Save uno-de-piera/d00f8aa938e2b5a32a36515b29ad9354 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
import moment from 'moment' | |
export default async ({ Vue }) => { | |
Vue.prototype.$moment = moment | |
} |
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> | |
<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> |
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
module.exports = function (/* ctx */) { | |
return { | |
boot: [ | |
'moment' | |
], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tambien funciona poniendo la opcion locale en el boot file. Gracias igualmente me ha servido.