
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
business-day-math
Advanced tools
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)
days
(Number
) requried: The number of days to add or subtract from the start date.startDate
(Date
) optional: The date to start from. If not provided, will default to today.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 are prova, based on tape. They can be run with npm test
.
To publish, run npm run release -- patch
FAQs
Add or subtract business days from a start date. Is timezone aware.
The npm package business-day-math receives a total of 3 weekly downloads. As such, business-day-math popularity was classified as not popular.
We found that business-day-math demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.