best-holiday
v1.1.5
Published
Holidays and JavaScript, now Customizable and Effortless
Downloads
313
Maintainers
Readme
best-holiday
Holidays and JavaScript; now Customizable and Effortless
About
Best-Holiday aims to make it easier for developers to interact with holidays in their applications. Best-Holiday can be used via the npm package or through the CDN for browser use.
The list of holidays can be found in src/index.ts. Holidays have four attributes:
name
: Name of the holidaydate
: Date of the holidaycountry
: Country where the holiday istype
: Type of the holiday
Installation
Installing Best-Holiday is simple.
npm In your project directory, run:
npm install best-holiday
yarn In your project directory, run:
yarn add best-holiday
If you want to use Best-Holiday in the browser environment, include this script tag in your HTML document:
<script src="https://cdn.jsdelivr.net/npm/best-holiday@latest/dist/browser/best-holiday.min.js"></script>
Usage
The Best-Holiday package currently exports six main functions:
getHolidaysForDays
: Returns an array of holidays for a given dategetHolidaysInRange
: Returns an array of holidays for a given rangesearchHolidays
: Returns an array of holidays for a given search querygetEasterRelatedHoliday
: Returns the Easter related holidayaddHoliday
: Adds a new holidayremoveHoliday
: Removes a holiday
For more detailed information about usage, refer to the Wiki.
License
Contributors
© 2024 The-Best-Codes