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

iobroker.public-holidays

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iobroker.public-holidays - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

6

io-package.json
{
"common": {
"name": "public-holidays",
"version": "0.0.1",
"version": "0.0.2",
"news": {
"0.0.2": {
"en": "Fix on first select no data where loaded \nAdd new holidays for Austria \nLoad new holidays to configuration",
"de": "Fix bei der ersten Auswahl wurden keine Daten geladen \nHinzufügen neuer Feiertage für Österreich \nLaden neuer Feiertage in die Konfiguration"
},
"0.0.1": {

@@ -7,0 +11,0 @@ "en": "initial release",

@@ -13,3 +13,41 @@ [

"enabled": true
},
{
"id": "nationalHoliday",
"name": "Staatsfeiertag",
"type": "political",
"date": "05-01",
"states": "Alle",
"ruleType": "fixed",
"offsetDay": null,
"referenceHoliday": null,
"weekdayInMonth": null,
"enabled": true
},
{
"id": "assumptionOfMary",
"name": "Maria-Himmelfahrt",
"type": "religion",
"date": "08-15",
"states": "Alle",
"ruleType": "fixed",
"offsetDay": null,
"referenceHoliday": null,
"weekdayInMonth": null,
"enabled": true
},
{
"id": "nationalHoliday",
"name": "Nationalfeiertag",
"type": "political",
"date": "10-26",
"states": "Alle",
"ruleType": "fixed",
"offsetDay": null,
"referenceHoliday": null,
"weekdayInMonth": null,
"enabled": true
}
]

@@ -42,5 +42,3 @@ 'use strict';

}
if (JSON.stringify(lastSettings) === JSON.stringify(this.config)) {
break updateSettings;
}
const adapterObject = await this.getForeignObjectAsync(

@@ -50,2 +48,31 @@ 'system.adapter.public-holidays.' + this.instance

// Check if new holidays exist in the country code holidays, add them if they do
const currentHolidays = adapterObject.native['holidays'] || [];
if (this.config.country === 'de') {
const newHolidays = deHolidays.filter(holiday => !currentHolidays.find(current => current.name === holiday.name));
if (newHolidays.length > 0) {
adapterObject.native['holidays'] = [...currentHolidays, ...newHolidays];
await this.setState(`info.lastSettings`, { val: adapterObject.native, ack: true });
await this.setForeignObjectAsync(
'system.adapter.public-holidays.' + this.instance,
adapterObject,
);
}
} else if (this.config.country === 'at') {
const newHolidays = atHolidays.filter(holiday => !currentHolidays.find(current => current.name === holiday.name));
if (newHolidays.length > 0) {
adapterObject.native['holidays'] = [...currentHolidays, ...newHolidays];
await this.setState(`info.lastSettings`, { val: adapterObject.native, ack: true });
await this.setForeignObjectAsync(
'system.adapter.public-holidays.' + this.instance,
adapterObject,
);
}
}
if (JSON.stringify(lastSettings) === JSON.stringify(this.config)) {
break updateSettings;
}
if (adapterObject === null || adapterObject === undefined) {

@@ -55,3 +82,3 @@ break updateSettings;

// Load original Settings after changing country
if (adapterObject.native.country !== lastSettings.country) {
if (lastSettings === '' || adapterObject.native.country !== lastSettings?.country) {

@@ -58,0 +85,0 @@ delete adapterObject.native['holidays'];

2

package.json
{
"name": "iobroker.public-holidays",
"version": "0.0.1",
"version": "0.0.2",
"description": "Calculates public holidays",

@@ -5,0 +5,0 @@ "author": {

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