Socket
Book a DemoInstallSign in
Socket

bank-calendar

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bank-calendar

This module provides a list of brazilian public holidays used by Brazil Bank System (Febraban).

1.0.4
latest
npmnpm
Version published
Weekly downloads
107
98.15%
Maintainers
1
Weekly downloads
 
Created
Source

Bank Calendar

This module provides a list of brazilian public holidays used by Brazil Bank System (Febraban).

The BankCalendar features are:

  • Returning next business day by provided date.
  • Returning a list of public holidays of the year by provided date.

Usage

CommonJS

const bankCalendar = require("bank-calendar");

console.log(bankCalendar.getNextWorkingDay(new Date(2022, 6, 30)));
////sab -> seg 2022-08-01T03:00:00.000Z
console.log(bankCalendar.getNextWorkingDay(new Date(2022, 6, 31)));
//dom -> seg 2022-08-01T03:00:00.000Z
console.log(bankCalendar.getNextWorkingDay(new Date(2022, 7, 1)));
//seg -> seg 2022-08-01T03:00:00.000Z

console.log(bankCalendar.getPublicHolidays(new Date('2022-01-01T03:00:00.000Z')));
/** list of public holidays
 [
  2022-01-01T03:00:00.000Z,
  2022-04-21T03:00:00.000Z,
  2022-05-01T03:00:00.000Z,
  2022-09-07T03:00:00.000Z,
  2022-10-12T03:00:00.000Z,
  2022-11-02T03:00:00.000Z,
  2022-11-15T03:00:00.000Z,
  2022-12-25T03:00:00.000Z,
  2022-04-17T15:01:59.425Z,
  2022-04-15T15:01:59.425Z,
  2022-02-28T15:01:59.425Z,
  2022-03-01T15:01:59.425Z,
  2022-06-16T15:01:59.425Z
]
 */

Typescript

import { getPublicHolidays, getNextWorkingDay} from "bank-calendar";

console.log(getNextWorkingDay(new Date(2022, 6, 30)));
////sab -> seg 2022-08-01T03:00:00.000Z
console.log(getNextWorkingDay(new Date(2022, 6, 31)));
//dom -> seg 2022-08-01T03:00:00.000Z
console.log(getNextWorkingDay(new Date(2022, 7, 1)));
//seg -> seg 2022-08-01T03:00:00.000Z

console.log(getPublicHolidays(new Date('2022-01-01T03:00:00.000Z')));
/** list of public holidays
 [
  2022-01-01T03:00:00.000Z,
  2022-04-21T03:00:00.000Z,
  2022-05-01T03:00:00.000Z,
  2022-09-07T03:00:00.000Z,
  2022-10-12T03:00:00.000Z,
  2022-11-02T03:00:00.000Z,
  2022-11-15T03:00:00.000Z,
  2022-12-25T03:00:00.000Z,
  2022-04-17T15:01:59.425Z,
  2022-04-15T15:01:59.425Z,
  2022-02-28T15:01:59.425Z,
  2022-03-01T15:01:59.425Z,
  2022-06-16T15:01:59.425Z
]
 */

Refecences

  • Public Calendar: Febraban Public Holidays.
  • Easter Sunday Calc: Easter Sunday Gauss' Algorithm

FAQs

Package last updated on 02 Aug 2022

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.