Hugging Face
Models
Datasets
Spaces
Posts
Docs
Solutions
Pricing
Log In
Sign Up
Spaces:
jbilcke-hf
/
ai-tube
like
279
Running
on
CPU Upgrade
App
Files
Files
Community
9
d41065b
ai-tube
/
src
/
lib
/
formatters
/
formatTimeAgo.ts
jbilcke
working to improve the clap format
f42b4a1
7 months ago
raw
Copy download link
history
blame
Safe
163 Bytes
import
{ formatDistance }
from
'date-fns'
export
function
formatTimeAgo
(
time:
string
) {
return
formatDistance
(
new
Date
(time),
new
Date
(), {
addSuffix
:
true
})
}