Is today a holiday
Node-red Workflow that checks if today is a holiday.
usage: change countrycode to appropriate country . use https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3 to find countryCode.
Returns boolean.
Made using kayaposoft.com implementation of Enrico Service.
[{"id":"557f2040.45edf","type":"function","z":"9dc02646.eff5a8","name":"","func":"// Create a Date object from the payload\nvar countrycode = \"dnk\"\nvar pre= \"https://kayaposoft.com/enrico/json/v2.0/?action=isPublicHoliday&date=\"\nvar post =\"&country=\"\n\nvar date = new Date(msg.payload);\n// Change the payload to be a formatted Date string\nmsg.payload = date.toString();\n// Return the message so it can be sent on\n\n// month and day\nvar month = date.getMonth() +1;\nvar day= date.getDate();\nvar year = date.getFullYear();\nvar today = day+\"-\"+month+\"-\"+year\nmsg.payload = pre+today+post+countrycode\nreturn msg;","outputs":1,"noerr":0,"x":170,"y":320,"wires":[["b3cc0aa7.344ad8"]]}]