8000 GitHub - tal/time-between: Node module to measure time between two dates only counting work hours
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Node module to measure time between two dates only counting work hours

License

Notifications You must be signed in to change notification settings

tal/time-between

Repository files navigation

Time Between

Time between is a simple utility to measure the number of work hours between two dates.

Installation

npm install time-between

or

yarn add time-between

Import with:

var timeBetween = require('time-between')

or

import timeBetween from 'time-between'

Usage

By default it assumes the work day is 10-6 and weekends are satuday and sunday.

let hoursBetween = timeBetween(dateOne, dateTwo)

Options

You can override the work hours and the weekend dates. Here's a call with all the default values:

timeBetween(dateOne, dateTwo, {
  dailyStart: 10,  // hour of the day that work starts
  dailyEnd: 6,     // hour of the day work ends
  voidDays: [6,0], // weekend days of the week (0-6 starting sunday)
})

About

Node module to measure time between two dates only counting work hours

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0