bank-calendar
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i bank-calendar

Weekly Downloads

24

Version

1.0.4

License

ISC

Unpacked Size

60.2 kB

Total Files

26

Last publish

Collaborators

  • leonardoandrade1