Answer the question
In order to leave comments, you need to log in
Why is date-fns example code not working with Vue?
I took the example directly from the main page, but it does not work in
Computed
import { format, formatDistance, formatRelative, subDays } from 'date-fns'
formatDistance(subDays(new Date(), 3), new Date())
import { formatDistance, subDays } from 'date-fns'
formattedValue () {
return formatDistance(subDays(new Date(), 3), new Date())
}
Object(...) is not a function
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question