Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

from-this-moment

pdkpavankumar22MIT1.1.1

a lightweight javascript library to get the date difference from this moment

from-now, date

readme

from-this-moment

Build Status dependencies Status devDependencies Status License: MIT

A light weight npm moulde gives the time difference

Happy hacking =)

Installation

npm install --save from-this-moment

Usage

import ftm from 'from-this-moment' (or)

var ftm = require('from-this-moment')

ftm(dateTo, dateFrom)

by default dateFrom is referenced to the current timedate.

ftm('Sat Mar 24 2019 0:32:01 GMT+0530 (India Standard Time)');

output: 23 minutes ago

ftm('Sat Mar 25 2019 0:32:01 GMT+0530 (India Standard Time)');

output: In 23 hours

ftm('Sat Mar 25 2017 0:32:01 GMT+0530 (India Standard Time)', 'Sat Mar 25 2019 0:32:01 GMT+0530 (India Standard Time)');

output: 2 years ago

License

MIT © PDK Pavan Kumar