bizdays-js
v1.0.4
Published
A useful library for working with business days
Downloads
5
Readme
bizdays-js
Biszdays is a simple library for working with business days.
Installation
This is a Node.js module available through the npm registry. Installation is done using one of the commands below
If you are using npm:
npm install bizdays-js
If you are using yarn:
yarn add bizdays-js
Usage
import bizdays from 'bizdays-js';
const today = new Date();
bizdays.setLocale('pt-BR');
console.log(bizdays.isBizday(today)) // shows true if today is a business day
console.log(bizdays.isHoliday(today)) // shows true if today is a holiday
console.log(bizdays.isWeekend(today)) // shows true if today is a weekend
const nextBusinessDay = bizdays.following(today) // get the next business day
console.log(nextBusinessDay)
const previousBusinessDay = bizdays.previous(today) // get the previous business day
console.log(previousBusinessDay)
Library Supported Locales
| Locale | Description | |--------|-------------| | pt-BR | Brazilian Portuguese |