Trying to use vue-moment. The simplest possible example from the documentation doesn\'t work: https://jsfiddle.net/rjcpz9wt/
{{ new Date() | moment \
/////EDIT/////
apparently you don't need to put moment inside a Vue.filter(....)
at all.
after you entered Vue.use(VueMoment)
in main.js
,
simply put a filter as shown in their documentation anywhere in your app and it just works
//////////////
I encountered the same problem, solved it by not using vue filters
this is my workaround, my main.js looks like this:
import Vue from 'vue'
import VueMoment from 'vue-moment';
Vue.use(VueMoment)
and in the component wherever i need to use moment it looks like this:
//IN METHODS:
methods: {
tellTime(time) {
console.log(this.$moment(time).format(' mm:ss'))
}
}
{{$moment(timestamp).fromNow()}}
Hope someone else would find it useful :)