Socket
Socket
Sign inDemoInstall

bank-calendar

Package Overview
Dependencies
3
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

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).


Version published
Weekly downloads
80
increased by70.21%
Maintainers
1
Created
Weekly downloads
 

Readme

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

Last updated on 02 Aug 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc