Skip to main content

Function: timeAgo()

function timeAgo(date: DateParam, options?: TimeAgoOptions): string;

Defined in: lib/util.ts:172

Returns the time elapsed since the given date.

Parameters

ParameterTypeDescription
dateDateParamThe date from which to calculate elapsed time.
optionsTimeAgoOptionsFormatting options: - 'brief': single-unit format (e.g. "5m", "2h") - 'mini': multi-unit format (e.g. "2m30s", "1h15m")

Returns

string

The formatted elapsed duration.