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