1.0.0 โข Published 1 year ago
@sensethenlove/get-relative-time v1.0.0
๐ @sensethenlove/get-relative-time
๐ Description
Simple function that recieves a date and gives back the relative time using Intl.RelativeTimeFormat('en', { numeric: 'auto' })
โฏ๏ธ Install
pnpm add @sensethenlove/get-relative-time
๐ Example
import { getRelativeTime } from '@sensethenlove/get-relative-time'
getRelativeTime(new Date()) // now
getRelativeTime(new Date('2023-05-05')) // tomorrow
getRelativeTime(new Date('1991-04-08')) // 32 years ago
๐งก Supports
- Seconds
- Minutes
- Hours
- Days
- Weeks
- Months
- Years
๐ Our helpful packages!
1.0.0
1 year ago