bdm

business-day-math

Add or subtract business days from a start date. Is timezone aware.

Showing:

Popularity

Downloads/wk

36

GitHub Stars

0

Maintenance

Last Commit

7yrs ago

Contributors

0

Package

Dependencies

1

Size (min+gzip)

98.3KB

License

Artistic-2.0

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Business Day Math

NPM Build Status

Business days are hard to calculate because you have to jump weekends. In addition, calculating across different timezones is difficult because the day of the week that the start date is on can vary.

This module allows you to accommodate all these needs.

Table of Contents generated with DocToc

Install

npm install business-day-math

Usage

var bizDays = require('business-day-math')
  , friPT = new Date('Fri May 9 2014 17:00:00 GMT-0700 (PST)')

 bizDays(1, friPT, 'America/Los_Angeles').toString() // Mon May 12 2014 17:00:00 GMT-0700 (PST)
 bizDays(-1, friPT, 'America/Los_Angeles').toString() // Thu May 8 2014 17:00:00 GMT-0700 (PST)

Options

  1. days (Number) requried: The number of days to add or subtract from the start date.
  2. startDate (Date) optional: The date to start from. If not provided, will default to today.
  3. timezone (String) optional: The timezone files are named as one of the options from the RFC 3999 list of timezones (e.g. "Europe/London" is GMT). If not provided will default to the computer's timezone.

Tests

Tests are prova, based on tape. They can be run with npm test.

Developing

To publish, run npm run release -- patch

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100