Files
docmost-ryan/client/src/lib/time-ago.ts
Philipinho 4cb7a56f65 feat: comments
* create comment
* reply to comment thread
* edit comment
* delete comment
* resolve comment
2023-11-09 16:52:34 +00:00

6 lines
168 B
TypeScript

import { formatDistanceStrict } from 'date-fns';
export function timeAgo(date: Date){
return formatDistanceStrict(new Date(date), new Date(), { addSuffix: true })
}