colombian-holidays
Advanced tools
Comparing version 1.8.0 to 1.8.1
{ | ||
"name": "colombian-holidays", | ||
"version": "1.8.0", | ||
"version": "1.8.1", | ||
"description": "Colombian holidays", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -69,2 +69,10 @@ # Colombian Holidays 🎆 | ||
You can opt-in to have the function return native JavaScript dates instead of strings for the `date` and `celebrationDate` properties by using the `returnNativeDate` option: | ||
<!-- prettier-ignore-start --> | ||
```js | ||
const colombianHolidays2015 = colombianHolidays(2015, { returnNativeDate }); | ||
``` | ||
If the year is omitted, by default the function will return the holidays for the current year: | ||
@@ -76,16 +84,56 @@ | ||
### TypeScript | ||
## Utils | ||
The module is written in TypeScript and type definitions files are included. | ||
The package provides two helper functions which can be imported from `lib/utils`: | ||
## Contributing | ||
### isHoliday | ||
Contributions, issues and feature requests are welcome! | ||
Returns true if the given date is a colombian holiday, otherwise returns false. | ||
## Show your support | ||
```js | ||
import { isHoliday } from 'colombian-holidays/lib/utils/isHoliday` | ||
Give a ⭐️ if you like this project! | ||
const date = new Date("2018-01-01T05:00:00.000Z") | ||
if (isHoliday(date)) { | ||
console.log('it is a colombian holiday'); | ||
} else { | ||
console.log('it is NOT a colombian holiday'); | ||
} | ||
``` | ||
### holidaysWithinInterval | ||
Returns an with the colombian holidays within two dates: | ||
```js | ||
import { holidaysWithinInterval } from 'colombian-holidays/lib/utils/holidaysWithinInterval` | ||
const start = new Date("2021-01-01"); | ||
const end = new Date("2021-01-11"); | ||
const holidays = holidaysWithinInterval({ start, end }); | ||
/* | ||
[ | ||
{ | ||
celebrationDate: "2021-01-01", | ||
date: "2021-01-01", | ||
name: "Año Nuevo", | ||
nextMonday: false, | ||
}, | ||
{ | ||
celebrationDate: "2021-01-11", | ||
date: "2021-01-06", | ||
name: "Reyes Magos", | ||
nextMonday: true, | ||
}, | ||
] | ||
*/ | ||
``` | ||
### TypeScript | ||
The module is written in TypeScript and type definitions files are included. | ||
## License | ||
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FMauricioRobayo%2Fcolombian-holidays.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FMauricioRobayo%2Fcolombian-holidays?ref=badge_large) |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
18815
18
146
138
0