🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

fed-banking-days

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fed-banking-days

Date helpers to calculate future banking days based on Federal Reserve holidays

latest
npmnpm
Version
1.3.0
Version published
Maintainers
0
Created
Source

@notablefi/fed-banking-days

A programmatic implementation of the Federal Reserve holiday schedule. Useful for providing timing estimates for Fed-processed transactions like ACH transfers.

Installation

Install using npm:

npm install fed-banking-days

Usage

Typescript:

import { nextBankingDay } from 'fed-banking-days';

or JavaScript:

const { nextBankingDay } = require('fed-banking-days');

nextBankingDay

The primary function, nextBankingDay, returns the Date that is the start of business (9am ET) on the next valid Fed banking day, as well as the latest holiday in between the given date and the next banking day.

For example:

…a Wednesday so the next banking day is tomorrow, Thursday.

> nextBankingDay(new Date('2022-06-15T06:00:00Z'))
[ 2022-06-16T13:00:00.000Z, undefined ]

…a Friday before a Sunday-holiday observed on Monday, so the next banking day is Tuesday.

> nextBankingDay(new Date('2022-06-17T06:00:00Z'))
[ 2022-06-21T13:00:00.000Z, 'Juneteenth National Independence Day' ]

Optionally, provide a minimum number of days to advance:

> nextBankingDay(new Date('2022-06-17T06:00:00Z'), 3)
[ 2022-06-23T13:00:00.000Z, 'Juneteenth National Independence Day' ]
> nextBankingDay(new Date('2022-06-17T06:00:00Z'), 10)
[ 2022-07-05T13:00:00.000Z, 'Independence Day' ]

useBusinessHours

By default, nextBankingDay will consider times after end-of-business (5pm ET) to be part of the next banking day, for more conservative estimates about ACH deposit availability. To disable this behavior and consider any time of a day to be part of that same banking day, pass useBusinessHours: false:

> nextBankingDay(new Date('2022-06-15T19:00:00-04:00')) // default behavior
[ 2022-06-17T13:00:00.000Z, undefined ]
> nextBankingDay(new Date('2022-06-15T19:00:00-04:00'), 1, { useBusinessHours: false })
[ 2022-06-16T13:00:00.000Z, undefined ]

Author

Notable Finance LLC

License

This package is licensed under the MIT License.

See ./LICENSE for more information.

Keywords

banking

FAQs

Package last updated on 12 Feb 2025

Did you know?

Socket

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.

Install

Related posts