Vue.js filters need to run before your app starts. In Nuxt, you do this by adding the filter as a plugin then registering it with your nuxt.config.js. This lesson walks you through create a date filter to better visually format the time.
what editor is this? I'm wondering how you're geting the full list of functions within date-fns
For anyone else following along, with the release of v2.0 of the "date-fns" module, the distanceInWordsToNow
function was deprecated. You will want to use the formatDistanceToNow
function instead.
In fact, you can use the addSuffix: true
option to automatically add a prefix or suffix, such as DATE ago or in DATE. formatDistanceToNow(time, {addSuffix: true})
For anyone else following along, with the release of v2.0 of the "date-fns" module, the
distanceInWordsToNow
function was deprecated. You will want to use theformatDistanceToNow
function instead.
Appreciate this