Loading...
Please waitLoading...
Please waitpnpm dlx uselab@latest add use-time-ago
import { useTimeAgo } from "@/hooks/use-time-ago"
export function Component() {
const timeAgo = useTimeAgo(new Date("2025-05-01T12:00:00Z"))
return (
<div>
<p>Time ago: {timeAgo}</p>
</div>
)
}| Name | Type | Description | Default Value | Optional |
|---|---|---|---|---|
date | Date | The date to format into a 'time ago' string. | - | No |
| Name | Type | Description |
|---|---|---|
timeAgo | string | The formatted time ago string. |
Last updated: 2 days ago