@bancacfplus/vacation
is a small static module that manages the days we are off or we don't process things
A function that accepts a date in YYYY-MM-DD
format and respond with a Boolean
Options: see options below
A function that accepts a date in YYYY-MM-DD
format and respond with the closest working day.
N.B. if the date passed to the function is a working date, you will have your value back.
Options: see options below
A function that accepts a year
and a month
parameter and returns the last working date of the month in YYYY-MM-DD
format
Options: see options below
{
withWeekends?: boolean = true // includes weekends to the valid vacation days check
withVacations?: boolean = true // includes the days from the vacations array the valid vacation days check
withHolidays?: boolean = true // includes the holidays from the holidays array to the valid vacation days check
withLastWorkDayOfMonth?: boolean = false // includes the last working day of the month to the check
}
You can directly access to the holidays
and vacations
arrays importing the module
build
: builds the packagetest
: yeah sometimes we also do TDD here...makesHolidays
: generates holidays array, the data will be saved in.src/data/holidays.ts
if you want to adding region to holidays: check the utils/makesHolidays.js
file
if you want to add or remove custom vacation days: manually edit the ./src/data/vacations.ts
file