bank-calendar
v1.0.4
Published
This module provides a list of brazilian public holidays used by Brazil Bank System (Febraban).
Downloads
289
Readme
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