I have created a file to store filters linked to my Vue object, and it is being imported
into my App.js. One of the filters I have needs to use another filter:
Vue.filter('formatDateTime', value => {
if (value) return moment(String(value)).format('DD-MMM-YY hh:mm')
});
Vue.filter('getActivity', value =>
(!value.lastvisited)
? 'Not visited yet'
: 'Last logged in ' + Vue.$options.filters.formatDateTime(value.lastvisited)
)
Unfortunately, this filter cannot reference the global Vue object. Is there a way to work around this issue? While I could simply duplicate the date formatting logic, I would prefer not to.