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
npm install business-day-math
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)
Number) requried: The number of days to add or subtract from the start date.
Date) optional: The date to start from. If not provided, will default to today.
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.
To publish, run
npm run release -- patch