date-since

1.0.0 • Public • Published

Date Since

Parses a javascript date and turns it into a "x time ago" format where time can be seconds, minutes, hours, days, or years.

example

> import dateSince from 'date-since'
> const time = new Date()
> console.log(dateSince(time))
2 seconds ago

methods

import dateSince from 'date-since';

dateSince(date)

returns a string that formats the date into the aforementioned format.

install

With npm do:

npm install date-since

license

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i date-since

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • rauljordan