ai-tube / src /lib /formatters /formatTimeAgo.ts
jbilcke's picture
working to improve the clap format
f42b4a1
raw
history blame
163 Bytes
import { formatDistance } from 'date-fns'
export function formatTimeAgo(time: string) {
return formatDistance(new Date(time), new Date(), { addSuffix: true })
}