A lightweight (1 KB) library that is used to find out humanly readable time differences between now and past date
$ npm install hologo
As of NPM 5.0.0, installed modules are added as a dependency by default, so the --save option is no longer used. The other save options still exist and are listed in the documentation for npm install.
When is it useful
The module will result in the same relative date outcome like StackOverflow sign-up date of users.
Example current date: April 18, 2018 12:00:00
const memberFor = ;memberFor;//=> '15 minutes'memberFor;//=> '1 hour'memberFor;//=> '2 hours'memberFor;//=> '1 day'memberFor; // 04/04/2018 12:00:00 AM//=> '14 days'memberFor;//=> '11 months'memberFor;//=> '1 year'memberFor;//=> '0 seconds'
;hologo'2017/03/18';//=> '1 year, 1 month'hologo'2012-02-14';//=> '6 years, 3 months'
You may pass it either any valid date string or timestamp in milliseconds.
If set, it will compare to the first parameter. Otherwise, it will stick with the current date.
MIT © JeffMinsungKim