1.1.1 • Published 5 years ago

user-friendly-date v1.1.1

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

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.