Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

italian-holidays

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

italian-holidays - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

17

index.js

@@ -387,2 +387,19 @@ const holidays_IT = {

}
}
export function getHolidaysOnlyDays(year = '') {
if (!year || year == '') {
const everyYearUnited = [...holidays_IT[2019], ...holidays_IT[2020], ...holidays_IT[2021], ...holidays_IT[2022], ...holidays_IT[2023]];
return everyYearUnited.map(holiday => {
return holiday.day;
}, []);
} else {
if (!['2019', '2020', '2021', '2022', '2023'].includes(year.toString())) {
throw new Error('Year not (yet) available');
} else {
return [...holidays_IT[year]].map(holiday => {
return holiday.day;
}, []);
}
}
}

2

package.json
{
"name": "italian-holidays",
"version": "1.2.0",
"version": "1.3.0",
"description": "tool to retrieve italian holidays",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,3 +5,4 @@ ![npm (scoped)](https://img.shields.io/npm/v/@marikamella/ita-holidays)

**only italian language available (english language coming soon)**
**only from 2019 to 2023 (for now)**
**only from 2019 to 2023 (for now)**
**some things are hardcoded af but this is a 10 minutes project, improvements are on their way**

@@ -16,2 +17,15 @@ usage:

`console.log(ita-holidays.getHolidays(2019, 'it'));`
`console.log(ita-holidays.getHolidays(2019, 'it'));`
this will get an object like this:
`{`
`id: 1,`
`day: '01/01/2019',`
`weekDay: 'martedì',`
`name: 'capodanno'`
`}`
`console.log(ita-holidays.getHolidaysOnlyDays(2019));`
**year is optional**
this will get an array of dates formatted like this: DD/MM/YYYY
if year is omitted, the array will include dates from current year to 2023
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc