Function: timeAgo()
function timeAgo(date: DateParam, options: TimeAgoOptions): string
Show the time passed since the given date, in the desired format.
Parameters
Parameter | Type | Description |
---|---|---|
date | DateParam | The date since which to calculate the duration. |
options | TimeAgoOptions | format takes "brief" or "mini". "brief" rounds the date and uses the largest suitable unit (e.g. "4 weeks"). "mini" uses something like "4w" (for 4 weeks). |
Returns
string
The formatted date.