1.0.0 • Published 3 years ago

whendys v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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