The question is how to format a JavaScript Date as a string stating the time elapsed similar to the way you see times displayed on Stack Overflow.
Date
e.g.<
Can also use the dayjs relativeTime plugin to solve this.
import * as dayjs from 'dayjs'; import * as relativeTime from 'dayjs/plugin/relativeTime'; dayjs.extend(relativeTime); dayjs(dayjs('1990')).fromNow(); // x years ago