2.1.0 • Published 2 years ago

italian-vacation v2.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

🏖Vacation 🏖

We work hard, but sometimes we just don't 🤷‍♀

italian-vacation is a small static module that manages the days we are off or we don't process things

isVacation(date[, options])

A function that accepts a date in YYYY-MM-DD format and respond with a Boolean Options: see options below

closestWorkingDay(date[, options])

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

getLastWorkDayOfMonth(year, month[, options])

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

Options

{
  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
}

Extras

You can directly access to the holidays and vacations arrays importing the module

Commands

  • build: builds the package
  • test: 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

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.2.6

2 years ago