Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera

uno-de-piera/Index.js

Last active May 9, 2020
Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@rdavid4 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
You can’t perform that action at this time.