user-friendly-date

1.1.1 • Public • Published

user-friendly-date

Shows the amount of time between two dates in a user-friendly way.

Usage

Install the package...

$ npm i user-friendly-date --save

...then...

const userFriendlyDate = require('user-friendly-date'); // or import userFriendlyDate from 'user-friendly-date
 
userFriendlyDate(new Date().getTime())
// -> Just now
 
userFriendlyDate(new Date().getTime() - 5000) // five seconds ago
// -> Five seconds ago
 
userFriendlyDate(new Date().getTime() - 1000 * 60 * 60 * 24) // the day before yesterday
// -> About 2 days ago

Hope this package helps you!

Found a bug? Open an issue, or ping me on Discord: Vehmloewff#0714.

Readme

Keywords

Package Sidebar

Install

npm i user-friendly-date

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

4.09 kB

Total Files

4

Last publish

Collaborators

  • vehmloewff