Time from X
Returns the string of relative time from X.
This requires the
RelativeTime
plugin to work
dayjs.extend(relativeTime)
var a = dayjs('2000-01-01')
dayjs('1999-01-01').from(a) // a year ago
If you pass true, you can get the value without the suffix.
dayjs.extend(relativeTime)
var a = dayjs('2000-01-01')
dayjs('1999-01-01').from(a, true) // a year