whendys
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

when, never why

Whendys is a small library used to get the time since a Date represented in an edible readable format.

"8 hours ago"

Example

import {when} from 'whendys'

// pretend it's June 23, 2021!

// String
let delay = when('June 26, 2020') // => 11 months ago

// Date object
delay = when(new Date('June 22 2021'))  // => 1 day ago

// Milliseconds
delay = when(1623643200000) // => 1 week ago

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1

Package Sidebar

Install

npm i whendys

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

12 kB

Total Files

15

Last publish

Collaborators

  • kysley