I need some JS code that will take the created_at value from a Twitter feed and display it as xxxx ago.
I can find examples of creating the xxxx a
import * as luxon from 'luxon';
// https://stackoverflow.com/a/20478182/5932012
const TWITTER_DATE_FORMAT = 'EEE MMM d HH:mm:ss ZZZ yyyy';
export const parseTwitterDate = (dateStr: string): luxon.DateTime =>
luxon.DateTime.fromString(dateStr, TWITTER_DATE_FORMAT);
export const formatTwitterDate = (dateTime: luxon.DateTime): string =>
dateTime.toFormat(TWITTER_DATE_FORMAT);