time-factory2

1.0.1 • Public • Published

Time Factory 2

manipulate time

difference between to date in

difIn(unit, date1, date2)

  • @param {string} unit: [ seconds / minutes / hours / days / months / years ]
  • @param {Date} date1
  • @param {Date} date2

get difference in

timeFactory.difIn('minutes', date1, date2);

cal(verb, number, unit, date)

  • @param {string} verb [add / remove ]
  • @param {number} number. what to add or remove
  • @param {string} unit: [ seconds / minutes / hours / days / months / years ]
  • @param {Date} date
timeFactory.cal('add', 4, 'days', new Date());

will return the date 4 days from now 

to(unit, date)

  • @param {string} unit: [ seconds / minutes / hours / days / months / years ]
  • @param {Date} date

conver date to hours

timeFactory.to('hours', new Date());

Readme

Keywords

none

Package Sidebar

Install

npm i time-factory2

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

3.39 kB

Total Files

3

Last publish

Collaborators

  • rahmasabry
  • qantra