Giter Site home page Giter Site logo

vacation's Introduction

🏖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

vacation's People

Contributors

makhbeth avatar dependabot[bot] avatar giuliacot avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.