UNPKG

js-ago

Version:

Simple time ago for Unix timestamps and JavaScript Date objects.

12 lines (11 loc) 376 B
/** * Converts a JavaScript Date object to "time ago" * @param {Date} timestamp * @param {Intl.RelativeTimeFormatOptions & Intl.LocalesArgument} options * @example "5 hours ago" * @example "5h ago" * @returns {string} */ export declare function jsAgo(timestamp: Date, options?: Partial<Intl.RelativeTimeFormatOptions> & { locale?: Intl.LocalesArgument; }): string;