1.0.0 โ€ข Published 1 year ago

@sensethenlove/get-relative-time v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

๐Ÿ•‰ @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!